/* STOOPKY.PL — restyle (sidebar + bold pink) */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

:root{
  /* palette (approx. to provided screenshots) */
  --bg: #ffffff;
  --app-bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: rgba(16, 24, 40, 0.10);
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.10);
  --shadow-sm: 0 6px 16px rgba(16, 24, 40, 0.08);
  --radius: 14px;
  --radius-sm: 12px;
  --primary: #ff2da3;
  --primary-2: #ff66bf;
  --primary-soft: rgba(255, 45, 163, 0.12);

  /* legacy aliases */
  --pink: var(--primary);
  --pink-2: #ffe1f1;
  --pink-3: var(--primary-2);

  --max: 1220px;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-shell {
  min-height: 100%;
  background: var(--app-bg);
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.90);
  border-bottom: 1px solid var(--border);
  transition: max-height 0.3s ease, padding 0.3s ease;
  overflow: hidden;
}
.topbar .container {
  position: relative;
}
.topbar-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease;
}
.topbar.collapsed {
  max-height: 50px;
}
.topbar.collapsed .topbar-inner {
  opacity: 0;
  max-height: 0;
  padding: 0;
  overflow: hidden;
}
.topbar-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 14px;
  color: var(--text);
  z-index: 21;
  transition: opacity 0.2s ease;
}
.topbar-toggle:hover {
  opacity: 0.7;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand img { height: 34px; width: auto; }
.brand .wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.brand .wordmark strong { font-size: 14px; }
.brand .wordmark span { font-size: 12px; color: var(--muted); font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav a {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
}
.nav a.active{
  color: var(--text);
  background: var(--primary-soft);
  border-color: rgba(255, 45, 163, 0.22);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16,24,40,0.10);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { background: rgba(255,255,255,0.98); border-color: rgba(16,24,40,0.18); }
.btn:active { transform: translateY(1px); }
.btn.primary{
  background: var(--primary);
  border-color: rgba(255,45,163,0.35);
  color: #ffffff;
}
.btn.primary:hover { filter: brightness(0.98); }
.btn.ghost{
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover{
  background: rgba(255, 45, 163, 0.08);
  border-color: rgba(255, 45, 163, 0.18);
  color: var(--text);
}
.btn.danger{
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.20);
  color: #7f1d1d;
}
.btn.small{ padding: 8px 11px; font-size: 13px; }

/* Disabled and loading states */
.btn:disabled,
.btn[data-loading="true"],
.chip:disabled,
.chip[data-loading="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

.btn:disabled:hover,
.btn[data-loading="true"]:hover,
.chip:disabled:hover,
.chip[data-loading="true"]:hover {
  background: inherit !important;
  border-color: inherit !important;
  filter: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.item:disabled,
.item[data-loading="true"],
button.item:disabled,
button.item[data-loading="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.message-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.message-form-actions .btn,
.message-form-actions label.btn,
.message-form-btn-attach,
.message-form-btn-tip {
  min-height: 24px !important;
  padding: 4px 8px !important;
  border: 1px solid rgba(16, 24, 40, 0.15) !important;
  background: #fff !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  transition: all 0.15s ease;
  border-radius: 6px !important;
}

.message-form-actions .btn.primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  padding: 4px 10px !important;
}

.message-form-actions label.btn {
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 4px !important;
  font-size: 0 !important;
}

.message-form-actions .btn:hover,
.message-form-actions label.btn:hover,
.message-form-btn-attach:hover,
.message-form-btn-tip:hover {
  background: rgba(255, 45, 163, 0.08) !important;
  border-color: rgba(255, 45, 163, 0.3) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 6px rgba(255, 45, 163, 0.15) !important;
  transform: translateY(-1px);
}

.message-form-actions .btn.primary:hover {
  background: var(--primary) !important;
  filter: brightness(0.95);
}

.message-form-buttons-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.message-form-btn-icon {
  min-height: 40px !important;
  min-width: 40px !important;
  padding: 10px !important;
  border: 1px solid rgba(16, 24, 40, 0.15) !important;
  background: #fff !important;
  color: var(--muted) !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: none !important;
}

.message-form-btn-icon:hover {
  background: rgba(255, 45, 163, 0.08) !important;
  border-color: rgba(255, 45, 163, 0.3) !important;
  color: var(--primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(255, 45, 163, 0.15) !important;
}

.message-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.gif-preview-btn {
  transition: all 0.15s ease;
}

.gif-preview-btn:hover {
  border-color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 45, 163, 0.2);
}

.message-form-btn-icon[data-tip-amount] {
  position: relative;
}

.message-form-btn-icon[data-tip-amount]::after {
  content: attr(data-tip-amount);
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1.2;
  min-width: 18px;
  text-align: center;
}

.pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16,24,40,0.10);
  background: rgba(255,255,255,0.92);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16,24,40,0.10);
  background: rgba(255,255,255,0.95);
  font-weight: 800;
  font-size: 12px;
  color: rgba(16,24,40,0.72);
  cursor: pointer;
}
.chip.active{
  color: var(--text);
  border-color: rgba(255,45,163,0.35);
  background: rgba(255,45,163,0.12);
}
.dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(255,45,163,0.18);
}

.page { padding: 18px 0 28px; }
.auth-page{ 
  padding: 0; 
  min-height: 100vh;
}
.auth-split{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--app-bg);
}
.auth-brand{
  background:
    radial-gradient(900px 520px at 20% 10%, rgba(255, 102, 191, 0.55), transparent 55%),
    radial-gradient(900px 520px at 90% 60%, rgba(255, 45, 163, 0.65), transparent 55%),
    linear-gradient(180deg, #ff2da3 0%, #ff5fbd 100%);
  color: #fff;
  padding: 46px 46px;
  display: grid;
  align-content: center;
}
.auth-brand-inner{ width: min(540px, 100%); }
.auth-brand-top{
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand-top img{ height: 48px; width: auto; filter: drop-shadow(0 8px 20px rgba(16,24,40,0.22)); }
.auth-brand-name{ font-weight: 900; letter-spacing: 0.2px; font-size: 20px; }
.auth-brand-tag{ opacity: 0.90; font-weight: 700; font-size: 13px; margin-top: 2px; }
.auth-brand h1{
  margin: 22px 0 0;
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -0.7px;
}
.auth-brand p{
  margin: 12px 0 0;
  opacity: 0.95;
  font-weight: 600;
  line-height: 1.55;
  max-width: 46ch;
}
.auth-form{
  padding: 28px;
  display: grid;
  place-items: center;
}
.auth-card{
  width: min(420px, 100%);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.auth-head strong{ font-size: 16px; letter-spacing: 0.1px; }
.oauth-stack{ display: grid; gap: 10px; }
.oauth-btn{
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16,24,40,0.12);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.oauth-btn:hover{ border-color: rgba(16,24,40,0.18); background: rgba(255,255,255,0.98); }
.oauth-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.oauth-divider::before,
.oauth-divider::after{
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(16,24,40,0.10);
}
.auth-check{
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

/* New auth classes from updated markup */
.auth-brand-center{
  display: grid;
  place-items: center;
  text-align: center;
}
.auth-brand-center img{
  display: block;
  max-width: 100%;
  height: auto;
}
.auth-brand-word{
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.1;
}
.auth-brand-sub{
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  margin-top: 12px;
  line-height: 1.4;
}
.auth-title{
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 24px;
}
.auth-fields{
  display: grid;
  gap: 14px;
  width: 100%;
}
.auth-input{
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(16,24,40,0.14);
  background: #fff;
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.12s ease;
}
.auth-input:focus{
  border-color: rgba(255,45,163,0.45);
  box-shadow: 0 0 0 3px rgba(255,45,163,0.10);
}
.auth-primary{
  width: 100%;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.auth-primary:hover{
  filter: brightness(0.95);
}
.auth-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after{
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(16,24,40,0.12);
}
.auth-oauth{
  display: grid;
  gap: 10px;
  width: 100%;
}
.oauth-btn{
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(16,24,40,0.12);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.oauth-btn:hover{
  border-color: rgba(16,24,40,0.18);
  background: rgba(255,255,255,0.98);
}
.oauth-ico{
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.oauth-ico.google{ color: #4285f4; }
.oauth-ico.apple{ color: #000; }
.oauth-ico.x{ color: #000; }
.auth-foot{
  margin-top: 20px;
  text-align: center;
}
.auth-foot-text{
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.auth-foot-link{
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-foot-link:hover{
  color: var(--primary-2);
}
.sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 920px){
  .auth-split{ grid-template-columns: 1fr; }
  .auth-brand{ display: none; }
  .auth-form{ padding: 18px; }
}
.hero {
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero-inner{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  padding: 22px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 40px);
  letter-spacing: -0.6px;
  color: var(--text);
}
.hero p { margin: 10px 0 0; color: var(--muted); font-weight: 600; line-height: 1.55; }
.hero-cta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.hero-card h3{ margin: 0 0 8px; font-size: 14px; letter-spacing: 0.2px; }
.hero-card ul { margin: 0; padding-left: 16px; color: var(--muted); font-weight: 600; line-height: 1.6; }

/* FIX: 3-column layout: [Sidebar] [Main with CreatePost + Feed] [Right Rail] */
.layout{
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
  transition: grid-template-columns 0.3s ease;
}
.layout > * {
  min-width: 0;
  /* Prevent grid items from breaking layout */
  position: relative;
}
.layout:has(.sidebar.collapsed) {
  grid-template-columns: 60px minmax(0, 1fr) 340px;
}
.layout-messages {
  grid-template-columns: 280px minmax(0, 2fr) minmax(0, 1fr);
}
.layout-messages:has(.sidebar.collapsed) {
  grid-template-columns: 60px minmax(0, 2fr) minmax(0, 1fr);
}

.messages-right-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar{ display: none; }
/* FIX: right panel must only contain sidebar content, not feed posts */
.right-panel{ 
  display: block; 
  position: sticky; 
  top: 18px; 
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  min-width: 0;
  /* Ensure no feed posts render here */
  /* Diagnostic border - remove after fix verification */
  /* border: 2px solid green; */
}

.sidebar.panel{
  background: var(--app-bg);
}
.sidebar .panel-bd{ padding: 14px; }
.sidebar-brand{
  padding: 16px 14px 10px;
  border-bottom: 1px solid rgba(16,24,40,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.sidebar-brand a{
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand img{ height: 36px; width: auto; }
.sidebar-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}
.sidebar-toggle:hover {
  background: rgba(16,24,40,0.08);
  color: var(--text);
}
.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}
.sidebar.collapsed .panel-bd {
  display: none;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
}
.sidebar.collapsed .sidebar-brand a {
  display: none;
}
.sidebar.collapsed .sidebar-toggle {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  font-size: 14px;
}
.layout {
  transition: grid-template-columns 0.3s ease;
}
.sidebar.collapsed ~ * {
  /* Adjust grid when sidebar is collapsed */
}
.sidebar-brand .wm{
  display: grid;
  line-height: 1.05;
}
.sidebar-brand .wm strong{ font-size: 15px; letter-spacing: 0.2px; }
.sidebar-brand .wm span{ font-size: 12px; color: var(--muted); font-weight: 700; }

@media (min-width: 980px){
  .topbar{ display: none; }
  .sidebar{ display: block; position: sticky; top: 18px; }
}

@media (min-width: 1220px){
  /* Layout already has 3 columns by default, no need to override */
  /* Keep right-panel visible and sticky */
  .right-panel{ 
    display: block; 
    position: sticky; 
    top: 18px; 
    max-height: calc(100vh - 36px);
    overflow-y: auto;
  }
}

.stories{
  display: flex;
  gap: 16px;
  padding: 8px 0 16px;
  margin: 0 0 24px;
  overflow: auto;
  scrollbar-width: none;
  justify-content: center;
}
.stories::-webkit-scrollbar{ display: none; }
.story{
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text);
}
.story-avatar{
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 3px solid var(--primary);
  box-shadow: 0 2px 4px rgba(16,24,40,0.08);
  overflow: hidden;
  flex-shrink: 0;
}
.story-avatar.has-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-avatar.has-stories {
  border: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(255, 45, 163, 0.3);
  animation: story-pulse 2s ease-in-out infinite;
}
@keyframes story-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(255, 45, 163, 0.3);
  }
  50% {
    box-shadow: 0 2px 12px rgba(255, 45, 163, 0.5);
  }
}
.story {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.story-name{
  display: none;
}
.panel{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel .panel-hd{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(16,24,40,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel .panel-hd h2{
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.panel .panel-bd{ padding: 14px; }

.list{ display: grid; gap: 10px; }
.list a.item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 700;
}
.list a.item:hover{
  background: rgba(255,45,163,0.08);
  border-color: rgba(255,45,163,0.18);
  color: var(--text);
}
.list a.item.active{
  background: rgba(16,24,40,0.08);
  border-color: transparent;
  color: var(--text);
}
.list button.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
  width: 100%;
  text-align: left;
  font: inherit;
}
.list button.item:hover {
  background: rgba(255, 45, 163, 0.08);
  border-color: rgba(255, 45, 163, 0.18);
  color: var(--text);
}
.list button.item:active {
  transform: translateY(1px);
}
.list .btn.ghost {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

/* Story Viewer Styles */
.story-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-viewer-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  aspect-ratio: 9/16;
  background: #000;
  display: flex;
  flex-direction: column;
}

.story-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  display: flex;
  gap: 4px;
  padding: 8px;
  z-index: 10;
}

.story-progress-segment {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-segment.active {
  background: rgba(255,255,255,0.5);
}

.story-progress-segment.viewed {
  background: rgba(255,255,255,0.8);
}

.story-progress-segment-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width linear;
}

.story-viewer-header {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
}

.story-viewer-close {
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: background 0.2s;
}

.story-viewer-close:hover {
  background: rgba(0,0,0,0.7);
}

.story-viewer-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.story-nav-btn {
  width: 40%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.story-nav-btn.story-nav-prev {
  justify-content: flex-start;
}

.story-nav-btn.story-nav-next {
  justify-content: flex-end;
}

.story-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.icon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,45,163,0.10);
  border: 1px solid rgba(255,45,163,0.18);
}
.icon svg {
  display: block;
  flex-shrink: 0;
}

.grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.col-6{ grid-column: span 6; }
.col-12{ grid-column: span 12; }
.col-4{ grid-column: span 4; }
.col-8{ grid-column: span 8; }

.card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card .card-bd{ padding: 14px; }
.muted{ color: var(--muted); }
.small{ font-size: 13px; }

.creator-cover{
  height: 110px;
  background: linear-gradient(180deg, rgba(255,45,163,0.10), rgba(255,45,163,0.04));
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}
.creator-cover.has-image{
  background-size: cover;
  background-position: center;
  /* background i background-image będą w inline style */
}
.creator-hd{
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px 14px;
}
.avatar{
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(16,24,40,0.12);
  box-shadow: 0 8px 16px rgba(16,24,40,0.10);
  background: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--text);
}
.avatar.has-image{ overflow: hidden; }
.avatar.has-stories {
  border: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(255, 45, 163, 0.3);
  animation: story-pulse 2s ease-in-out infinite;
  cursor: pointer;
}
.avatar.has-stories:hover {
  box-shadow: 0 2px 12px rgba(255, 45, 163, 0.5);
}
.avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.story-add-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.story-add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(255, 45, 163, 0.3);
}

.post-media{
  height: 220px;
  border-bottom: 1px solid rgba(16,24,40,0.08);
  background: linear-gradient(180deg, rgba(16,24,40,0.03), rgba(16,24,40,0.01));
  display: grid;
  place-items: center;
  position: relative;
}
.post-media .lock{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.55);
  color: #3a0f23;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.form{
  display: grid;
  gap: 10px;
}
.field label{
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: rgba(16,24,40,0.70);
  margin-bottom: 6px;
}
.input, .textarea, .select{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(16,24,40,0.14);
  background: #fff;
  padding: 10px 12px;
  outline: none;
  box-shadow: none;
}
.textarea{ min-height: 92px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus{
  border-color: rgba(255, 45, 163, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 45, 163, 0.14);
}

.footer{
  margin-top: 26px;
  padding: 18px 0 28px;
  color: rgba(100,116,139,0.92);
}
.footer a{ color: rgba(100,116,139,0.92); font-weight: 700; }
.footer a:hover{ color: var(--text); }
.footer-inner{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(15,23,42,0.10);
  padding-top: 14px;
}

/* Modal */
.modal-root{ position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.modal-overlay{
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal{
  width: min(520px, 100%);
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal .modal-hd{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal .modal-hd strong{ letter-spacing: 0.2px; }
.modal .modal-bd{ padding: 14px; }

/* Toasts */
.toast-root{
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: grid;
  gap: 10px;
}
.toast{
  width: min(360px, calc(100vw - 28px));
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.toast strong{ font-size: 13px; }
.toast span{ font-size: 13px; color: var(--muted); font-weight: 600; }

.noscript{
  width: min(740px, calc(100% - 32px));
  margin: 18px auto;
  border-radius: var(--radius);
  border: 1px solid rgba(239,68,68,0.22);
  background: rgba(239,68,68,0.08);
  padding: 12px 14px;
  color: #7f1d1d;
  font-weight: 800;
}

/* Responsive */
/* Feed styles */
.feed-page{ padding: 0; }
/* FIX: feed must render under CreatePost in main column */
.feed-main{
  background: var(--app-bg);
  padding: 24px;
  min-height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* Diagnostic border - remove after fix verification */
  /* border: 2px solid red; */
}
.feed-section{
  margin-bottom: 32px;
}
.feed-section-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
  color: var(--text);
  margin: 0 0 16px;
  text-align: center;
}
/* FIX: feed posts must stay in main column, not float to right */
.feed-posts{
  display: grid;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  /* Ensure no positioning that breaks layout */
  position: relative;
  /* Diagnostic border - remove after fix verification */
  /* border: 2px solid blue; */
}

.post-card{
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(16,24,40,0.06);
}
.post-media{
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  background: linear-gradient(180deg, rgba(16,24,40,0.03), rgba(16,24,40,0.01));
  overflow: hidden;
}
.post-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-play-overlay{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.3);
  cursor: pointer;
}
.post-play-icon{
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--text);
}
.post-content{
  padding: 12px 14px 14px;
}
.post-header{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-avatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(16,24,40,0.10);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}
.post-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-username{
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
}
.post-caption{
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 10px;
}
.post-caption-user{
  font-weight: 800;
  margin-right: 6px;
}
.post-engagement{
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.post-engagement-btn{
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.post-engagement-btn:hover{
  color: var(--text);
}
.post-engagement-icon{
  font-size: 20px;
  line-height: 1;
}
.post-engagement-count{
  font-size: 14px;
}
.post-comment-input-wrapper{
  border-top: 1px solid rgba(16,24,40,0.08);
  padding-top: 10px;
}
.post-comment-input{
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.post-comment-input::placeholder{
  color: var(--muted);
  font-weight: 600;
}

/* Reels styles */
.reels-page{ padding: 0; }
.reels-main{
  background: var(--app-bg);
  padding: 0;
  min-height: 100vh;
  overflow-y: auto;
  max-width: 100%;
}
.reels-title{
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0;
  padding: 16px;
  text-align: center;
  position: sticky;
  top: 0;
  background: var(--app-bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.reels-container{
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 100%;
  margin: 0 auto;
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  scroll-behavior: smooth;
}
.reel-card{
  background: #000;
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  position: relative;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.reel-media{
  width: 100%;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  position: relative;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.reel-controls-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}
.reel-controls-top{
  padding: 16px;
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}
.reel-controls-bottom{
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
.reel-control-btn{
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  transition: all 0.2s ease;
  pointer-events: auto;
}
.reel-control-btn:hover{
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}
.reel-seek-container{
  width: 100%;
}
.reel-seek{
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.reel-seek::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
.reel-seek::-moz-range-thumb{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}
.reel-volume-container{
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.reel-volume-slider-wrapper{
  position: absolute;
  left: 52px;
  bottom: 0;
  width: 120px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.reel-volume{
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.reel-volume::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
.reel-volume::-moz-range-thumb{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}
.reel-content{
  position: absolute;
  right: 16px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  z-index: 6;
  pointer-events: none;
}
.reel-header a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.reel-header a:hover {
  opacity: 0.8;
}
.reel-header{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  pointer-events: auto;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 20px;
}
.reel-avatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}
.reel-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reel-username{
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}
.reel-engagement{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}
.reel-engagement-btn{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  border: none;
  padding: 12px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  transition: all 0.2s ease;
}
.reel-engagement-btn:hover{
  background: rgba(0,0,0,0.6);
  transform: scale(1.1);
}
.reel-engagement-icon{
  font-size: 24px;
  line-height: 1;
}
.reel-engagement-count{
  font-size: 12px;
  line-height: 1;
}

/* Tips overlay - wyświetlane nad video */
.reel-tips-overlay{
  position: absolute;
  top: 60px;
  left: 16px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 12px;
  z-index: 7;
  pointer-events: auto;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.reel-tips-header{
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.reel-tip-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.reel-tip-item:last-child{
  border-bottom: none;
}
.reel-tip-user{
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  flex: 1;
}
.reel-tip-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex: 1;
}
.reel-tip-item a:hover .reel-tip-user{
  opacity: 0.8;
  text-decoration: underline;
}
.reel-tip-amount{
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  margin-left: 12px;
}

/* Comments overlay removed - not intuitive */

/* Like button animations */
.reel-like-btn{
  position: relative;
  overflow: visible;
}
.reel-heart-icon{
  transition: all 0.3s ease;
  display: inline-block;
}
.reel-like-btn[data-liked="true"] .reel-heart-icon{
  color: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary));
}
.reel-like-btn.liked .reel-heart-icon{
  animation: heartPulse 0.6s ease;
}
@keyframes heartPulse{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.4); }
  100%{ transform: scale(1.2); }
}

/* Floating hearts animation */
.reel-hearts-animation{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: visible;
}
.reel-heart-float{
  position: absolute;
  font-size: 20px;
  color: var(--primary);
  pointer-events: none;
  animation: floatHeart 1.5s ease-out forwards;
  opacity: 0;
}
@keyframes floatHeart{
  0%{
    opacity: 1;
    transform: translateY(0) translateX(0) scale(0.5) rotate(0deg);
  }
  50%{
    opacity: 1;
    transform: translateY(-30px) translateX(10px) scale(1) rotate(15deg);
  }
  100%{
    opacity: 0;
    transform: translateY(-60px) translateX(20px) scale(0.8) rotate(30deg);
  }
}

/* === REELS — IG-STYLE COMMENTS DRAWER + TIP SHEET + OVERLAY ON VIDEO === */
.sheet-backdrop{
  position:fixed; inset:0; z-index:9999;
  background: rgba(0,0,0,0.55);
  display:flex; align-items:flex-end; justify-content:center;
  padding: 12px;
  opacity: 1;
  transition: opacity .16s ease;
}
.sheet-backdrop.closing{ opacity:0; }
.sheet{
  width: min(640px, 100%);
  background: #fff;
  border-radius: 18px 18px 18px 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  overflow:hidden;
  max-height: 72vh;
  display:flex; flex-direction:column;
  transform: translateY(0);
  transition: transform .16s ease;
}
.sheet.small{ max-height: 52vh; }
.sheet-hd{
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  position:relative;
}
.sheet-grab{
  position:absolute; left:50%; top:8px; transform:translateX(-50%);
  width: 52px; height: 5px; border-radius: 999px;
  background: rgba(0,0,0,0.12);
}
.sheet-title{ font-weight: 900; font-size: 14px; padding-top: 10px; }
.sheet-x{
  border:none; background:#fff; cursor:pointer;
  width: 36px; height: 36px; border-radius: 12px;
  border:1px solid rgba(0,0,0,0.08);
}

.sheet-bd{ padding: 12px 14px; overflow:auto; }
.sheet-ft{
  padding: 12px 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display:flex; gap:10px;
  background: #fff;
}
.sheet-ft .input{ flex:1; }
.sheet-empty{ color: var(--muted); font-size: 13px; padding: 8px 2px; }

.cmt{ background:#fafafa; border:1px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 10px; }
.cmt + .cmt{ margin-top: 10px; }
.cmt-meta{ font-size: 11px; color: var(--muted); font-weight: 800; }
.cmt-text{ margin-top: 6px; font-size: 13px; color: var(--text); line-height: 1.25; }

.tip-hint{ font-weight: 900; margin-bottom: 10px; }
.tip-quick{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 12px; }
.tip-pill{
  padding: 10px 12px; border-radius: 999px;
  border:1px solid rgba(0,0,0,0.10);
  background:#fff; cursor:pointer; font-weight: 900;
}
.tip-pill:hover{ transform: translateY(-1px); }
.tip-form{ display:flex; flex-direction:column; gap:10px; }
.tip-actions{ display:flex; gap:10px; justify-content:flex-end; }

.reel-last-badge{
  position:absolute;
  left: 14px;
  bottom: 96px;
  z-index: 5;
  max-width: calc(100% - 28px);
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.52);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.14);
  display:flex; align-items:center; gap:8px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events:none;
}
.reel-last-badge.tip{ bottom: 132px; }
.reel-last-badge.show{
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 620px){
  .sheet{ max-height: 78vh; }
  .reel-last-badge{ bottom: 88px; }
  .reel-last-badge.tip{ bottom: 124px; }
}

/* Chat styles */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-panel-container {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 200px;
  max-height: none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.message-form-container {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  min-height: fit-content;
}

.message-textarea {
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
}

.message-bubble-wrapper {
  display: flex;
  width: 100%;
}

.message-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.message-bubble.mine {
  align-self: flex-end;
  background: rgba(246, 193, 209, 0.4);
  margin-left: auto;
}

.message-bubble.other {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.9);
  margin-right: auto;
}

.message-bubble code {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.message-bubble strong {
  font-weight: 900;
}

.message-bubble em {
  font-style: italic;
}

.message-bubble u {
  text-decoration: underline;
}

.message-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 4px 0;
  display: block;
}

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .right-panel{ display: none; }
  .hero-inner{ grid-template-columns: 1fr; }
  .feed-main{ padding: 16px; }
  .reels-main{ padding: 16px; }
  .reels-grid{ grid-template-columns: 1fr; }
  .chat-messages {
    max-height: calc(100vh - 250px);
  }
}

@media (prefers-reduced-motion: reduce){
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* === FEED PAGE LAYOUT — PROPORTIONS UPDATE (feed wider) === */
.feed-page .container{
  max-width: 1280px;
}

.feed-page .layout{
  display:grid !important;
  /* left = slightly smaller, main = much bigger, right = noticeably smaller */
  grid-template-columns: 260px minmax(0, 1fr) 300px !important;
  gap: 24px !important;
  align-items:start !important;
}

/* keep column assignment */
.feed-page .layout > .sidebar{ grid-column: 1 !important; }
.feed-page .layout > .feed-main{ grid-column: 2 !important; min-width:0 !important; }
.feed-page .layout > .right-panel{ grid-column: 3 !important; min-width:0 !important; }

/* make side panels readable but not dominant */
.feed-page .layout > .sidebar .panel.sidebar{
  width: 100% !important;
}
.feed-page .layout > .right-panel{
  max-width: 300px !important;
}

/* nie pozwól, aby main rozpychał pionowo i robił wielkie przerwy */
.feed-page .feed-main{
  display:flex !important;
  flex-direction:column !important;
  justify-content:flex-start !important;
  height:auto !important;
  min-height:0 !important;
  gap: 18px !important;
}

/* wyzeruj inline margin-top:24px na sekcjach (spacing robimy przez gap) */
.feed-page .feed-main .feed-section{ margin-top: 0 !important; }

/* right panel nie może pływać/absolutnie pozycjonować */
.feed-page .right-panel{
  float:none !important;
  position:static !important;
  width:auto !important;
}

/* dopiero na mniejszych ekranach 1 kolumna */
@media (max-width: 980px){
  .feed-page .layout{ grid-template-columns: 1fr !important; }
  .feed-page .layout > .sidebar,
  .feed-page .layout > .feed-main,
  .feed-page .layout > .right-panel{ grid-column: 1 !important; }
}

/* Ograniczenia wysokości dla sekcji "Utwórz Post" */
.feed-page .feed-main .card{ max-width: 760px; }
.feed-page .feed-main .textarea{ max-height: 140px; }
.feed-page .post-file-preview-content{ max-height: 120px; }
.feed-page .post-file-preview{ max-height: 180px; overflow:auto; }
