.pulse-stories-strip { display: none !important; }

.skip-link, html[dir="rtl"] .skip-link { display: none !important; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr !important; display: block !important; }
  .app-main { width: 100% !important; padding-bottom: 80px !important; }

  .app-side {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    background: var(--surface, #1a1f44) !important;
    z-index: 1100 !important;
    overflow-y: auto !important;
    transition: transform .28s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 0 0 30px rgba(0,0,0,.5);
    padding: 16px 12px !important;
    margin: 0 !important;
    border: 0 !important;
    display: flex !important;
    flex-direction: column;
  }

  html[dir="ltr"] .app-side, html:not([dir="rtl"]) .app-side {
    left: 0 !important; right: auto !important;
    transform: translateX(-105%) !important;
    border-right: 1px solid var(--line, rgba(255,255,255,.08)) !important;
  }
  html[dir="rtl"] .app-side {
    right: 0 !important; left: auto !important;
    transform: translateX(105%) !important;
    border-left: 1px solid var(--line, rgba(255,255,255,.08)) !important;
  }

  .app-side.open, .app-side.is-open {
    transform: translateX(0) !important;
  }

  body.nav-open { overflow: hidden; }

  .shafx-mobile-scrim {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .shafx-mobile-scrim.show {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 961px) {
  .shafx-mobile-scrim, .app-bottom-nav { display: none !important; }
}

.app-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface, #1a1f44);
  border-top: 1px solid var(--line, rgba(255,255,255,.08));
  z-index: 900;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0,0,0,.3);
}
@media (max-width: 960px) {
  .app-bottom-nav { display: flex; justify-content: space-around; }
}
.app-bottom-nav a {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 7px 4px;
  font-size: .62rem; font-weight: 600;
  color: var(--text-2, #b9c0e4); text-decoration: none;
  min-height: 54px;
}
.app-bottom-nav a svg { width: 22px; height: 22px; }
.app-bottom-nav a.active { color: var(--brand, #ffcc00); }
html[dir="rtl"] .app-bottom-nav { direction: rtl; }

.shafx-stories-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 14px 2px 18px;
  margin: 16px 0 8px;
  scroll-snap-type: x mandatory;
}
.shafx-stories-strip::-webkit-scrollbar { height: 0; }

.shafx-story-card {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  scroll-snap-align: start;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  background: var(--surface-2, #2a2f54);
  border: 3px solid transparent;
  transition: transform .15s ease;
  overflow: visible;
}
.shafx-story-card:hover { transform: scale(1.05); }
.shafx-story-card.unviewed {
  border-color: #ffcc00;
  box-shadow: 0 0 0 2px var(--bg, #0b0e1c), 0 0 0 5px #ffcc00;
}
.shafx-story-card.viewed {
  border-color: rgba(255,255,255,.2);
}

.shafx-story-card .inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}
.shafx-story-card .bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.shafx-story-card .text-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  font-size: .55rem; font-weight: 700; line-height: 1.2;
  text-align: center;
  color: #fff;
  overflow: hidden;
}

.shafx-story-card .author-label {
  position: absolute;
  bottom: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: .62rem;
  color: var(--text-2, #b9c0e4);
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.shafx-story-card.add {
  background: transparent;
  border: 2px dashed rgba(255,204,0,.4);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: #ffcc00;
}
.shafx-story-card.add .plus-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #ffcc00;
  color: #191d34;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
  line-height: 1;
}

dialog.shafx-story-create {
  background: var(--surface, #1a1f44);
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 14px;
  padding: 0; max-width: 480px; width: 92vw;
  color: var(--text, #f4f6ff);
}
dialog.shafx-story-create::backdrop { background: rgba(0,0,0,.7); }
.shafx-story-create form { padding: 22px; }
.shafx-story-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.shafx-story-tab {
  padding: 10px;
  background: var(--surface-2, #2a2f54);
  color: var(--text-2, #b9c0e4);
  border: 1px solid var(--line, rgba(255,255,255,.08));
  border-radius: 8px;
  cursor: pointer; font-weight: 700; font-size: .9rem;
}
.shafx-story-tab.active { background: #ffcc00; color: #191d34; border-color: #ffcc00; }
.shafx-story-bg-picker { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.shafx-story-bg {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
}
.shafx-story-bg.selected { border-color: #ffcc00; }

.shafx-img-preview {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 240px;
  display: none;
  border: 1px solid var(--line);
}
.shafx-img-preview.show { display: block; }
.shafx-img-preview img { width: 100%; height: auto; display: block; }
.shafx-img-info {
  margin-top: 6px;
  font-size: .74rem;
  color: #22c55e;
  display: none;
}
.shafx-img-info.show { display: block; }

dialog.shafx-story-viewer {
  background: transparent; border: 0; padding: 0;
  max-width: 460px; width: 92vw; max-height: 92vh;
}
dialog.shafx-story-viewer::backdrop { background: rgba(0,0,0,.95); }
.shafx-story-view-card {
  width: 100%; aspect-ratio: 9/16;
  border-radius: 14px; overflow: hidden;
  position: relative;
  background: #000;
}
.shafx-story-progress {
  position: absolute; top: 10px; left: 10px; right: 10px;
  height: 3px; display: flex; gap: 4px; z-index: 10;
}
.shafx-story-progress span {
  flex: 1; background: rgba(255,255,255,.3); border-radius: 99px;
  overflow: hidden;
}
.shafx-story-progress span.done { background: rgba(255,255,255,.95); }
.shafx-story-progress span.active::after {
  content: ''; display: block; height: 100%;
  background: #fff; width: 0;
  animation: storyFill 6s linear forwards;
}
@keyframes storyFill { to { width: 100%; } }
.shafx-story-close {
  position: absolute; top: 22px; right: 14px;
  background: rgba(0,0,0,.4); border: 0; color: #fff;
  font-size: 1.4rem; cursor: pointer; z-index: 11;
  width: 32px; height: 32px; border-radius: 50%;
  line-height: 1;
}
.shafx-story-view-body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 40px 24px;
  font-size: 1.25rem; font-weight: 700;
  color: #fff; text-align: center;
}
.shafx-story-view-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.shafx-story-view-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  color: #fff; padding: 24px 18px 28px;
  font-size: .92rem;
}
.shafx-story-view-author {
  position: absolute; top: 26px; left: 16px;
  color: #fff; font-size: .82rem; font-weight: 700; z-index: 11;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .app-topbar { flex-direction: row-reverse !important; }
html[dir="rtl"] .panel-head, html[dir="rtl"] .kpi .lbl { text-align: right; }
html[dir="rtl"] table th, html[dir="rtl"] table td { text-align: right; }
html[dir="rtl"] .feed-composer, html[dir="rtl"] .feed-item { text-align: right; }
html[dir="rtl"] .feed-item-head, html[dir="rtl"] .feed-author { flex-direction: row-reverse !important; }
html[dir="rtl"] input[type="text"], html[dir="rtl"] input[type="search"],
html[dir="rtl"] input[type="password"], html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align: right; }
html[dir="rtl"] code, html[dir="rtl"] .symbol,
html[dir="rtl"] [class*="-sym"], html[dir="rtl"] .number,
html[dir="rtl"] [class*="-amt"], html[dir="rtl"] [class*="-price"] {
  direction: ltr; unicode-bidi: embed; display: inline-block;
}
html[dir="rtl"] .brand-mark { direction: ltr !important; flex-direction: row !important; }
