/* Shahr Qesse shared UI shell — one stylesheet for every public page. */
:root {
  --sq-shell-ink: #254d49;
  --sq-shell-ink-soft: #376761;
  --sq-shell-muted: #71827b;
  --sq-shell-paper: #fffdf8;
  --sq-shell-mint: #dff3e7;
  --sq-shell-mint-strong: #bde8d1;
  --sq-shell-line: #e2e9df;
  --sq-shell-shadow: 0 15px 42px rgba(38, 75, 61, .12);
  --sq-shell-header-height: 78px;
}
body.dark-mode {
  --sq-shell-ink: #eef7f0;
  --sq-shell-ink-soft: #c8e7d9;
  --sq-shell-muted: #b5c6bf;
  --sq-shell-paper: #202b29;
  --sq-shell-mint: #253d34;
  --sq-shell-mint-strong: #2d5245;
  --sq-shell-line: #384641;
  --sq-shell-shadow: 0 15px 42px rgba(0, 0, 0, .28);
}

/* Shared header: same markup and styles on SPA, SEO and static pages. */
.sq-shell-header {
  position: sticky;
  top: 0;
  z-index: 1500;
  width: 100%;
  box-sizing: border-box;
  color: var(--sq-shell-ink);
  background: rgba(255, 253, 248, .94);
  border-bottom: 1px solid rgba(209, 224, 213, .82);
  box-shadow: 0 7px 24px rgba(35, 77, 67, .065);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
}
.sq-shell-header.sq-shell-header--fixed { position: fixed; inset: 0 0 auto 0; }
body.dark-mode .sq-shell-header { background: rgba(27, 40, 36, .95); border-bottom-color: rgba(180, 220, 198, .13); }
.sq-shell-header-inner {
  width: 100%; max-width: 1320px; min-height: var(--sq-shell-header-height);
  margin: 0 auto; padding: 8px clamp(12px, 2.4vw, 30px); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sq-shell-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; min-width: 0; color: var(--sq-shell-ink)!important; text-decoration: none!important; }
.sq-shell-logo { display: inline-flex; align-items: center; justify-content: center; width: 47px; height: 47px; flex: 0 0 47px; overflow: hidden; border-radius: 16px; border: 1px solid rgba(197,221,202,.72); background: linear-gradient(145deg,#fff3cf,#d8f2e1); box-shadow: 0 5px 14px rgba(36,86,67,.1); }
.sq-shell-logo img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; }
.sq-shell-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; line-height: 1.4; }
.sq-shell-brand-copy strong { color: var(--sq-shell-ink); font-weight: 950; font-size: 1.06rem; white-space: nowrap; }
.sq-shell-brand-copy small { color: var(--sq-shell-muted); font-weight: 650; font-size: .67rem; white-space: nowrap; }
.sq-shell-desktop-nav { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.sq-shell-nav-link, .sq-shell-nav-toggle {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; box-sizing: border-box; padding: 0 12px; border: 1px solid transparent;
  border-radius: 13px; background: transparent; color: var(--sq-shell-ink)!important;
  text-decoration: none!important; font: 800 .82rem 'Vazirmatn', Tahoma, sans-serif;
  white-space: nowrap; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.sq-shell-nav-link:hover, .sq-shell-nav-toggle:hover, .sq-shell-nav-dropdown.is-open .sq-shell-nav-toggle { background: var(--sq-shell-mint); border-color: var(--sq-shell-line); transform: translateY(-1px); }
.sq-shell-nav-dropdown { position: relative; display: inline-flex; }
.sq-shell-nav-toggle i { font-size: .65rem; }
.sq-shell-nav-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 185px; max-height: min(65vh, 420px); overflow: auto;
  display: none; flex-direction: column; gap: 3px; padding: 7px; border: 1px solid var(--sq-shell-line);
  border-radius: 16px; background: var(--sq-shell-paper); box-shadow: var(--sq-shell-shadow);
}
.sq-shell-nav-dropdown.is-open .sq-shell-nav-panel { display: flex; }
.sq-shell-nav-panel a { display: flex; align-items: center; min-height: 39px; padding: 8px 11px; border-radius: 10px; color: var(--sq-shell-ink)!important; text-decoration: none!important; font-size: .8rem; font-weight: 750; white-space: nowrap; }
.sq-shell-nav-panel a:hover { background: var(--sq-shell-mint); }
.sq-shell-header-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; }
.sq-shell-icon-button, .sq-shell-mobile-toggle {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px;
  padding: 0; border: 1px solid var(--sq-shell-line); border-radius: 14px; background: var(--sq-shell-paper);
  color: var(--sq-shell-ink); box-shadow: 0 4px 12px rgba(43,76,65,.045); font-size: .95rem; cursor: pointer;
}
.sq-shell-icon-button:hover, .sq-shell-mobile-toggle:hover { background: var(--sq-shell-mint); }
.sq-shell-mobile-toggle { display: none; }
.sq-shell-login {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 0 15px; box-sizing: border-box; border: 1px solid #c6e7d2; border-radius: 14px;
  background: linear-gradient(135deg,#dff4e6,#c8ecd7); color: #24564b!important;
  text-decoration: none!important; white-space: nowrap; font: 850 .82rem 'Vazirmatn', Tahoma, sans-serif;
  box-shadow: 0 4px 12px rgba(44,113,83,.08); transition: transform .18s ease, box-shadow .18s ease;
}
.sq-shell-login:hover { transform: translateY(-1px); box-shadow: 0 8px 17px rgba(44,113,83,.12); }
.sq-shell-login i { font-size: .9rem; }

/* A single account component is used for all page types. */
.sq-shell-account { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; z-index: 1501; }
.sq-shell-account-trigger {
  appearance: none; display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 48px;
  padding: 3px 7px; border: 1px solid transparent; border-radius: 16px; background: transparent;
  color: var(--sq-shell-ink); box-shadow: none; font-family: inherit; text-align: right; white-space: nowrap; cursor: pointer;
}
.sq-shell-account-trigger:hover, .sq-shell-account.is-open .sq-shell-account-trigger, .sq-shell-account:focus-within .sq-shell-account-trigger { background: rgba(223,243,231,.55); border-color: rgba(197,221,202,.75); }
body.dark-mode .sq-shell-account-trigger:hover, body.dark-mode .sq-shell-account.is-open .sq-shell-account-trigger { background: rgba(68,112,92,.2); border-color: rgba(140,187,158,.22); }
.sq-shell-avatar { display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(145deg,#2a4d4f,#3d8170); color: #fff!important; font-size: .95rem; font-weight: 950; line-height: 1; box-shadow: 0 4px 12px rgba(42,77,79,.16); }
.sq-shell-account-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; line-height: 1.35; }
.sq-shell-account-copy small { display: block; color: var(--sq-shell-muted); font-size: .65rem; font-weight: 800; }
.sq-shell-account-copy strong { display: block; max-width: 118px; overflow: hidden; text-overflow: ellipsis; color: var(--sq-shell-ink); font-size: .81rem; font-weight: 950; }
.sq-shell-account-chevron { color: var(--sq-shell-muted); font-size: .65rem; }
.sq-shell-account-dropdown { position: absolute; top: calc(100% + 7px); left: 0; z-index: 1510; display: none; width: 220px; box-sizing: border-box; padding: 7px; border: 1px solid var(--sq-shell-line); border-radius: 17px; background: var(--sq-shell-paper); box-shadow: var(--sq-shell-shadow); }
.sq-shell-account.is-open .sq-shell-account-dropdown, .sq-shell-account:focus-within .sq-shell-account-dropdown { display: block; }
.sq-shell-account-dropdown a, .sq-shell-account-dropdown button { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 41px; padding: 9px 11px; box-sizing: border-box; border: 0; border-radius: 10px; background: transparent; color: var(--sq-shell-ink)!important; text-align: right; text-decoration: none!important; font: 800 .8rem 'Vazirmatn', Tahoma, sans-serif; cursor: pointer; }
.sq-shell-account-dropdown a:hover, .sq-shell-account-dropdown button:hover { background: var(--sq-shell-mint); }
.sq-shell-account-dropdown .sq-shell-logout { color: #b64e49!important; }
.sq-shell-account-divider { height: 1px; margin: 5px 4px; background: var(--sq-shell-line); }
.sq-shell-mobile-nav { display: none; }

/* Shared footer. */
.sq-shell-footer { margin-top: 42px; padding: 36px clamp(15px,3vw,34px) 0; color: #f3faef; background: linear-gradient(130deg,#244e47 0%,#2c6256 58%,#254d49 100%); direction: rtl; font-family: 'Vazirmatn', Tahoma, sans-serif; }
body.dark-mode .sq-shell-footer { background: linear-gradient(130deg,#172b27 0%,#203b34 58%,#182e29 100%); }
.sq-shell-footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.9fr) minmax(0,.85fr) minmax(0,.9fr) minmax(0,.7fr); gap: clamp(16px,2.25vw,30px); padding-bottom: 28px; }
.sq-shell-footer-col { min-width: 0; }
.sq-shell-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: #fff8df; font-size: 1.17rem; font-weight: 950; }
.sq-shell-footer-brand img { width: 43px; height: 43px; padding: 3px; box-sizing: border-box; object-fit: contain; border-radius: 14px; background: linear-gradient(145deg,#fff4d1,#d8f2e1); }
.sq-shell-footer-description { margin: 0; max-width: 340px; color: #d0e4d8; font-size: .85rem; line-height: 2; }
.sq-shell-footer-title { margin: 0 0 13px; color: #fff8df; font-size: .95rem; font-weight: 900; }
.sq-shell-footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sq-shell-footer-links a { color: #e0eee4!important; text-decoration: none!important; font-size: .83rem; line-height: 1.8; transition: color .18s ease, transform .18s ease; }
.sq-shell-footer-links a:hover { color: #ffe29a!important; transform: translateX(-2px); }
.sq-shell-footer-socials { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.sq-shell-social-link { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; box-sizing: border-box; border: 1px solid rgba(255,255,255,.23); border-radius: 14px; background: rgba(255,255,255,.11); color: #fff8df!important; text-decoration: none!important; font-size: 1.15rem; transition: transform .18s ease,background .18s ease; }
.sq-shell-social-link:hover { transform: translateY(-2px); background: rgba(255,255,255,.22); }
.sq-shell-social-link[aria-label*="ایتا"] { color: #c8f4df!important; }
.sq-shell-social-link[aria-label*="تلگرام"] { color: #b9e8ff!important; }
.sq-shell-social-link[aria-label*="اینستاگرام"] { color: #ffe0d9!important; }
.sq-shell-social-link[aria-label*="ایمیل"] { color: #ffe7a8!important; }
.sq-shell-footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; max-width: 1280px; margin: 0 auto; padding: 15px 0 18px; border-top: 1px solid rgba(224,243,230,.17); color: #c7ded1; font-size: .75rem; line-height: 1.9; }

@media (max-width: 1050px) {
  .sq-shell-header-inner { gap: 10px; }
  .sq-shell-desktop-nav { gap: 1px; }
  .sq-shell-nav-link,.sq-shell-nav-toggle { padding-inline: 8px; font-size: .76rem; }
  .sq-shell-brand-copy small { display: none; }
  .sq-shell-footer-inner { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .sq-shell-footer-social-col { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  :root { --sq-shell-header-height: 62px; }
  .sq-shell-header-inner { min-height: 62px; padding: 6px 11px; gap: 8px; }
  .sq-shell-brand { gap: 7px; }
  .sq-shell-logo { width: 39px; height: 39px; flex-basis: 39px; border-radius: 13px; }
  .sq-shell-brand-copy strong { font-size: .93rem; }
  .sq-shell-desktop-nav { display: none; }
  .sq-shell-header-actions { gap: 5px; }
  .sq-shell-icon-button,.sq-shell-mobile-toggle { width: 36px; height: 36px; min-width: 36px; flex-basis: 36px; border-radius: 12px; }
  .sq-shell-mobile-toggle { display: inline-flex; }
  .sq-shell-account-trigger { min-height: 38px; gap: 5px; padding: 1px 4px; border-radius: 12px; }
  .sq-shell-avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: .8rem; }
  .sq-shell-account-copy { gap: 0; }
  .sq-shell-account-copy small { font-size: .54rem; }
  .sq-shell-account-copy strong { max-width: 82px; font-size: .66rem; }
  .sq-shell-account-chevron { display: none; }
  .sq-shell-account-dropdown { left: auto; right: 0; }
  .sq-shell-login { width: 37px; height: 37px; min-height: 37px; flex-basis: 37px; padding: 0; border-radius: 12px; }
  .sq-shell-login .sq-shell-login-label { display: none; }
  .sq-shell-mobile-nav { position: absolute; top: calc(100% + 7px); right: 10px; left: 10px; z-index: 1510; display: none; flex-direction: column; gap: 2px; max-height: calc(100dvh - 92px); overflow: auto; box-sizing: border-box; padding: 8px; border: 1px solid var(--sq-shell-line); border-radius: 20px; background: var(--sq-shell-paper); color: var(--sq-shell-ink); box-shadow: var(--sq-shell-shadow); }
  .sq-shell-mobile-nav.is-open { display: flex; }
  .sq-shell-mobile-link { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; box-sizing: border-box; padding: 10px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--sq-shell-ink)!important; text-decoration: none!important; font: 800 .83rem 'Vazirmatn', Tahoma, sans-serif; text-align: right; }
  .sq-shell-mobile-link:hover { background: var(--sq-shell-mint); }
  .sq-shell-mobile-account { padding: 10px 9px 7px; margin-top: 3px; border-top: 1px solid var(--sq-shell-line); }
  .sq-shell-mobile-account-head { display: flex; align-items: center; gap: 10px; padding: 6px 3px 10px; }
  .sq-shell-mobile-account-head .sq-shell-account-copy strong { max-width: 220px; font-size: .85rem; }
  .sq-shell-mobile-account .sq-shell-mobile-link { min-height: 39px; }
  .sq-shell-footer { margin-top: 30px; padding: 27px 15px 0; }
  .sq-shell-footer-inner { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 18px; padding-bottom: 22px; }
  .sq-shell-footer-brand-col,.sq-shell-footer-install-col,.sq-shell-footer-social-col { grid-column: 1 / -1; }
  .sq-shell-footer-description { max-width: 100%; }
  .sq-shell-footer-bottom { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 13px; font-size: .72rem; }
}
@media (max-width: 375px) {
  .sq-shell-header-inner { gap: 5px; padding-inline: 8px; }
  .sq-shell-brand-copy strong { font-size: .83rem; }
  .sq-shell-account-trigger { gap: 3px; }
  .sq-shell-avatar { width: 29px; height: 29px; flex-basis: 29px; }
  .sq-shell-account-copy small { font-size: .5rem; }
  .sq-shell-account-copy strong { max-width: 64px; font-size: .6rem; }
  .sq-shell-header-actions { gap: 3px; }
  .sq-shell-icon-button,.sq-shell-mobile-toggle { width: 33px; height: 33px; min-width: 33px; flex-basis: 33px; }
  .sq-shell-login { width: 34px; height: 34px; min-height: 34px; flex-basis: 34px; }
  .sq-shell-footer-inner { gap: 20px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sq-shell-header *, .sq-shell-footer * { transition: none!important; scroll-behavior: auto!important; }
}


/* Polished, accessible theme switch — one style across every public page. */
.sq-shell-icon-button.sq-shell-theme-switch {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: flex-start;
  width: 54px; min-width: 54px; max-width: 54px; height: 30px; min-height: 30px;
  flex: 0 0 54px; padding: 0; border-radius: 999px;
  border: 1px solid #b8d9c4;
  background: linear-gradient(110deg, #cfeedd 0%, #edf8e9 100%);
  color: #426a55; box-shadow: inset 0 1px 2px rgba(30,80,56,.08), 0 4px 11px rgba(38,92,64,.09);
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease, transform .18s ease;
}
.sq-shell-theme-switch::before {
  content: ''; position: absolute; z-index: -1; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fffdf5; box-shadow: 0 2px 6px rgba(39,78,55,.18);
  transition: right .22s ease, left .22s ease, background .22s ease, box-shadow .22s ease;
}
.sq-shell-theme-switch i { position: absolute; top: 50%; right: 8.5px; transform: translateY(-50%); font-size: 11px; line-height: 1; color: #547a60; transition: color .22s ease; }
.sq-shell-theme-switch:hover { transform: translateY(-1px); border-color: #8fc5a4; box-shadow: inset 0 1px 2px rgba(30,80,56,.08), 0 7px 15px rgba(38,92,64,.14); }
.sq-shell-theme-switch:active { transform: scale(.97); }
.sq-shell-theme-switch:focus-visible, .sq-shell-mobile-toggle:focus-visible, .sq-shell-login:focus-visible {
  outline: 3px solid rgba(255, 180, 86, .8); outline-offset: 3px;
}
body.dark-mode .sq-shell-icon-button.sq-shell-theme-switch {
  border-color: #426e61; background: linear-gradient(110deg, #18352f 0%, #2b5148 100%);
  color: #f3d88a; box-shadow: inset 0 1px 2px rgba(0,0,0,.16), 0 4px 12px rgba(0,0,0,.2);
}
body.dark-mode .sq-shell-theme-switch::before { right: auto; left: 3px; background: #ffe5a2; box-shadow: 0 2px 7px rgba(0,0,0,.22); }
body.dark-mode .sq-shell-theme-switch i { right: auto; left: 8.5px; color: #6f5725; }
body.dark-mode .sq-shell-theme-switch:hover { border-color: #5a8f7e; }
.sq-shell-mobile-toggle { transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.sq-shell-mobile-toggle:active { transform: scale(.96); }
.sq-shell-icon-button:focus-visible, .sq-shell-mobile-toggle:focus-visible { outline-offset: 3px; }

/* Favorite heart behaves like a real accessible toggle. */
.bookmark-btn.story-favorite-btn {
  position: relative; flex: 0 0 46px; width: 46px; height: 46px;
  border: 1px solid rgba(208, 223, 210, .96); border-radius: 50%;
  background: linear-gradient(145deg, #fffefa 0%, #f0f9f2 100%);
  color: #54736a; box-shadow: 0 6px 18px rgba(42,77,79,.10);
  transition: transform .18s ease, box-shadow .18s ease, background .22s ease, border-color .22s ease;
}
.bookmark-btn.story-favorite-btn:hover { transform: translateY(-2px); border-color: #e6a4b2; box-shadow: 0 9px 21px rgba(163,68,87,.15); }
.bookmark-btn.story-favorite-btn:active { transform: scale(.94); }
.bookmark-btn.story-favorite-btn:focus-visible { outline: 3px solid rgba(255,140,66,.68); outline-offset: 3px; }
.bookmark-btn.story-favorite-btn i { transition: transform .2s ease, color .2s ease; }
.bookmark-btn.story-favorite-btn.is-saved,
.bookmark-btn.story-favorite-btn[aria-pressed="true"] {
  background: linear-gradient(145deg, #fff0f3 0%, #ffe0e8 100%); border-color: #f0a5b5; color: #e34e70;
}
.bookmark-btn.story-favorite-btn.is-saved i,
.bookmark-btn.story-favorite-btn[aria-pressed="true"] i { color: #e34e70; transform: scale(1.08); }
body.dark-mode .bookmark-btn.story-favorite-btn { border-color: #40554c; background: linear-gradient(145deg,#273a33,#20302b); color: #bfd8c8; }
body.dark-mode .bookmark-btn.story-favorite-btn.is-saved,
body.dark-mode .bookmark-btn.story-favorite-btn[aria-pressed="true"] { background: linear-gradient(145deg,#4a2934,#38222b); border-color: #905064; color: #ff8ba6; }

/* Friendly sign-in prompt for guests trying to save a favorite story. */
.sq-favorite-modal-backdrop {
  position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center;
  padding: 18px; box-sizing: border-box; background: rgba(20, 39, 32, .48);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); animation: sqFavoriteFadeIn .18s ease-out;
  direction: rtl; font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.sq-favorite-modal {
  position: relative; width: min(100%, 410px); box-sizing: border-box; padding: 30px 24px 22px;
  border: 1px solid #dceadf; border-radius: 26px; background: linear-gradient(145deg,#fffdf7 0%,#f2fbf4 100%);
  color: #2a4d4f; text-align: center; box-shadow: 0 28px 85px rgba(18,46,34,.28); animation: sqFavoritePopIn .22s ease-out;
}
.sq-favorite-modal-close {
  position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid #e0e9df; border-radius: 50%; background: #fff; color: #64796f; font: 500 1.3rem/1 'Vazirmatn',sans-serif; cursor: pointer;
}
.sq-favorite-modal-icon { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 22px; background: linear-gradient(145deg,#ffe8ee,#fff4dc); color: #e45a78; font-size: 1.7rem; box-shadow: inset 0 0 0 1px rgba(227,126,149,.14); }
.sq-favorite-modal-eyebrow { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #e5f4e9; color: #4b7862; font-size: .73rem; font-weight: 850; }
.sq-favorite-modal h2 { margin: 12px 0 8px; color: #2a4d4f; font-size: 1.25rem; line-height: 1.8; }
.sq-favorite-modal p { margin: 0; color: #667b71; font-size: .88rem; line-height: 2; }
.sq-favorite-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.sq-favorite-modal-actions a { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; box-sizing: border-box; border-radius: 13px; text-decoration: none!important; font: 850 .82rem 'Vazirmatn',Tahoma,sans-serif; transition: transform .17s ease, box-shadow .17s ease; }
.sq-favorite-modal-actions a:hover { transform: translateY(-1px); }
.sq-favorite-modal-primary { background: linear-gradient(135deg,#2a5a4f,#377666); color: #fff!important; box-shadow: 0 7px 16px rgba(42,90,79,.17); }
.sq-favorite-modal-secondary { border: 1px solid #cfe5d4; background: #e9f7ed; color: #2e6554!important; }
.sq-favorite-modal-later { appearance: none; display: inline-flex; justify-content: center; margin-top: 13px; padding: 6px 14px; border: 0; background: transparent; color: #71837b; font: 750 .8rem 'Vazirmatn',Tahoma,sans-serif; cursor: pointer; }
body.dark-mode .sq-favorite-modal { border-color: #42564b; background: linear-gradient(145deg,#202f29 0%,#263d34 100%); color: #edf6ef; }
body.dark-mode .sq-favorite-modal-close { border-color: #45584d; background: #2d4137; color: #e4f0e7; }
body.dark-mode .sq-favorite-modal-eyebrow { background: #304c3c; color: #bbe2c7; }
body.dark-mode .sq-favorite-modal h2 { color: #f1f7f2; }
body.dark-mode .sq-favorite-modal p { color: #c3d2c8; }
body.dark-mode .sq-favorite-modal-secondary { border-color: #42654f; background: #30483a; color: #d4f0dc!important; }
body.dark-mode .sq-favorite-modal-later { color: #bacbc0; }
@keyframes sqFavoriteFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sqFavoritePopIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 820px) {
  .sq-shell-icon-button.sq-shell-theme-switch { width: 48px; min-width: 48px; max-width: 48px; height: 28px; min-height: 28px; flex-basis: 48px; }
  .sq-shell-theme-switch::before { width: 20px; height: 20px; top: 3px; }
  .sq-shell-theme-switch i { font-size: 10px; right: 7.5px; }
  body.dark-mode .sq-shell-theme-switch i { right: auto; left: 7.5px; }
  .sq-favorite-modal { padding: 28px 19px 20px; border-radius: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .sq-shell-theme-switch, .sq-shell-theme-switch::before, .sq-shell-theme-switch i,
  .bookmark-btn.story-favorite-btn, .bookmark-btn.story-favorite-btn i,
  .sq-favorite-modal-backdrop, .sq-favorite-modal { animation: none !important; transition: none !important; }
}


/* Account dashboard favorite stories: keep the saved items visible and directly navigable. */
.account-empty-inline { display:grid; justify-items:center; gap:.5rem; padding:1.35rem; text-align:center; color:var(--text-muted,#718078); }
.account-empty-inline > span { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; background:#e9f6ec; color:#42745a; font-size:1.45rem; }
.account-empty-inline p { margin:0; }
.account-empty-inline a { color:#2a6a50; font-weight:800; text-decoration:none; }
.favorite-story-link { display:flex !important; align-items:center; gap:13px; min-width:0; color:inherit !important; text-decoration:none !important; border:1px solid #e0ece1; box-shadow:0 5px 15px rgba(37,75,54,.035); }
.favorite-story-link:hover { border-color:#a8d4b5; transform:translateY(-2px); }
.favorite-story-cover { width:64px; height:76px; flex:0 0 64px; object-fit:cover; border-radius:12px; background:#e6efe6; }
.favorite-story-copy { display:grid; gap:5px; min-width:0; flex:1; }
.favorite-story-link .favorite-title { display:block; overflow-wrap:anywhere; line-height:1.7; }
.favorite-story-link .favorite-meta { display:block; margin:0; }
.favorite-story-arrow { flex:0 0 auto; color:#729580; font-size:.8rem; }
body.dark-mode .favorite-story-link { border-color:#3c5144; background:#202d26; }
body.dark-mode .favorite-story-link .favorite-title { color:#e6f1e8; }
body.dark-mode .account-empty-inline > span { background:#2d4938; color:#c9ebd1; }

/* Shared, accessible and polished notification toasts. */
#toast { position:fixed; z-index:100500; top:22px; right:22px; bottom:auto; width:min(410px,calc(100vw - 32px)); display:grid; gap:10px; pointer-events:none; direction:rtl; }
.story-toast { box-sizing:border-box; display:flex; align-items:center; gap:12px; width:100%; min-height:62px; padding:13px 14px; border:1px solid #d7e8da; border-radius:18px; background:rgba(255,253,247,.97); color:#294d3e; box-shadow:0 16px 42px rgba(30,59,42,.18); font:700 .9rem/1.9 'Vazirmatn',Tahoma,sans-serif; opacity:0; transform:translateY(-9px) scale(.985); transition:opacity .2s ease,transform .2s ease; animation:none; animation-fill-mode:initial; pointer-events:auto; -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); }
.story-toast.is-visible { opacity:1; transform:translateY(0) scale(1); }
.story-toast.success { border-color:#cfe7d4; }
.story-toast.error { border-color:#f0d0cd; background:rgba(255,248,247,.98); color:#8b3833; }
.story-toast-icon { display:grid; place-items:center; width:37px; height:37px; flex:0 0 37px; border-radius:12px; background:#e3f4e7; color:#2e7b50; font-size:1.15rem; }
.story-toast.error .story-toast-icon { background:#ffe5e1; color:#c04b42; }
.story-toast-message { flex:1; min-width:0; overflow-wrap:anywhere; }
.story-toast-close { display:grid; place-items:center; width:30px; height:30px; flex:0 0 30px; border:0; border-radius:50%; background:transparent; color:#77867b; font:400 1.4rem/1 'Vazirmatn',Tahoma,sans-serif; cursor:pointer; }
.story-toast-close:hover { background:rgba(60,90,68,.09); }
body.dark-mode .story-toast { border-color:#405b49; background:rgba(31,46,37,.97); color:#e8f3ea; box-shadow:0 16px 42px rgba(0,0,0,.32); }
body.dark-mode .story-toast.error { border-color:#774744; background:rgba(55,34,34,.98); color:#ffe6e3; }
body.dark-mode .story-toast-icon { background:#2c5039; color:#bce7c7; }
body.dark-mode .story-toast.error .story-toast-icon { background:#613632; color:#ffd0c9; }
body.dark-mode .story-toast-close { color:#c0d0c4; }
@media(max-width:640px) { #toast { top:12px; right:12px; width:calc(100vw - 24px); } .story-toast { min-height:56px; padding:10px 11px; border-radius:15px; font-size:.84rem; } .story-toast-icon { width:33px; height:33px; flex-basis:33px; border-radius:10px; } }
@media(prefers-reduced-motion:reduce) { .story-toast { transition:none; } }

/* Polished review form and comments for both SPA and server-rendered story pages. */
.story-reviews-section { max-width:1000px; margin:2rem auto; padding:0 1rem; direction:rtl; color:var(--text-color,#2a4d4f); }
.story-reviews-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.story-reviews-eyebrow { font-size:.78rem; font-weight:800; color:#54836d; }
.story-reviews-heading h2 { margin:.25rem 0; font-size:1.45rem; line-height:1.8; }
.story-reviews-heading p { margin:0; color:var(--text-muted,#718078); font-size:.9rem; }
.story-review-count { flex:0 0 auto; padding:.45rem .8rem; border:1px solid #d8e9dc; border-radius:999px; background:#f0f8f1; color:#346650; font-size:.8rem; font-weight:800; }
.story-review-form { padding:1.25rem; border:1px solid #dbeadf; border-radius:22px; background:linear-gradient(145deg,#fbfef9,#f0f8f1); box-shadow:0 10px 28px rgba(38,78,55,.06); margin-bottom:1.25rem; }
.story-review-label { display:block; margin-bottom:.65rem; font-weight:800; color:#2a4d4f; }
.story-review-textarea { box-sizing:border-box; display:block; width:100%; min-height:112px; resize:vertical; padding:1rem; border:1px solid #cfdfd2; border-radius:15px; background:#fffdf8; color:#2a4d4f; font:inherit; line-height:1.9; outline:none; transition:border-color .2s,box-shadow .2s; }
.story-review-textarea:focus { border-color:#72a98b; box-shadow:0 0 0 4px rgba(93,159,118,.12); }
.story-review-form-bottom { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; margin-top:.85rem; }
.story-rating-picker { display:flex; align-items:center; gap:.7rem; color:#688075; font-size:.85rem; font-weight:700; }
.story-rating-picker .rating-stars { display:flex; gap:.25rem; margin:0; }
.story-rating-picker .rating-star { border:0; background:transparent; color:#c6cfc5; font-size:1.65rem; line-height:1; cursor:pointer; padding:0 .08rem; opacity:1; transition:transform .15s,color .15s; }
.story-rating-picker .rating-star.active { color:#f0b73e; }
.story-review-submit { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; min-height:44px; padding:.7rem 1.25rem; border:0; border-radius:13px; background:linear-gradient(135deg,#2a5a4f,#43866f); color:#fff; font:800 .9rem 'Vazirmatn',Tahoma,sans-serif; cursor:pointer; box-shadow:0 7px 16px rgba(42,90,79,.15); }
.story-review-submit:disabled { opacity:.65; cursor:wait; }
.story-review-hint { margin:.85rem 0 0; color:#7b8c80; font-size:.77rem; }
.story-review-login-card { display:flex; align-items:center; gap:1rem; padding:1rem; border:1px solid #dceadf; border-radius:18px; background:#f5fbf5; margin-bottom:1.25rem; }
.story-review-login-icon { flex:0 0 42px; height:42px; display:grid; place-items:center; border-radius:14px; background:#e5f3e8; color:#39765a; font-size:1.15rem; }
.story-review-login-card strong { display:block; color:#2a4d4f; font-size:.92rem; }
.story-review-login-card p { margin:.2rem 0 0; color:#718078; font-size:.82rem; line-height:1.8; }
.story-review-login-link { margin-right:auto; flex:0 0 auto; padding:.65rem .9rem; border-radius:12px; background:#2a5a4f; color:#fff!important; text-decoration:none!important; font-size:.82rem; font-weight:800; }
.story-comments-list { display:grid; gap:.8rem; }
.story-review-item { padding:1rem 1.1rem; border:1px solid #e1e9df; border-radius:18px; background:#fffef9; box-shadow:0 5px 16px rgba(40,70,50,.035); }
.story-review-item-header { display:flex; align-items:center; gap:.7rem; }
.story-review-user-avatar { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:50%; background:linear-gradient(135deg,#d8f0df,#f8e6b3); color:#2a5a4f; font-weight:900; }
.story-review-user-details { display:grid; gap:.15rem; min-width:0; }
.story-review-user-details strong { color:#2a4d4f; font-size:.88rem; }
.story-review-user-details span { color:#8a978d; font-size:.74rem; }
.story-review-static-rating { margin-right:auto; white-space:nowrap; color:#d3d9d1; letter-spacing:1px; }
.story-review-static-rating .is-active { color:#f0b73e; }
.story-review-item-text { margin:.8rem 0 0; color:#52675c; line-height:2; white-space:normal; overflow-wrap:anywhere; }
.story-comments-empty { display:grid; justify-items:center; text-align:center; padding:1.6rem 1rem; border:1px dashed #ccded0; border-radius:18px; background:#f8fcf7; color:#718078; }
.story-comments-empty span { font-size:1.6rem; margin-bottom:.25rem; }
.story-comments-empty strong { color:#3b6550; }
.story-comments-empty p { margin:.35rem 0 0; font-size:.84rem; }
body.dark-mode .story-review-form, body.dark-mode .story-review-item, body.dark-mode .story-review-login-card, body.dark-mode .story-comments-empty { background:#202f29; border-color:#3b5547; }
body.dark-mode .story-review-label, body.dark-mode .story-reviews-heading h2, body.dark-mode .story-review-login-card strong, body.dark-mode .story-review-user-details strong, body.dark-mode .story-review-item-text { color:#e2eee5; }
body.dark-mode .story-review-textarea { background:#17231e; color:#edf6ef; border-color:#40594a; }
body.dark-mode .story-review-count { background:#294437; border-color:#42634f; color:#c6e9d0; }
body.dark-mode .story-review-login-icon { background:#304b3b; color:#caefd4; }
@media(max-width:700px) { .story-reviews-section { padding:0 .65rem; } .story-reviews-heading { align-items:flex-start; flex-direction:column; } .story-review-form { padding:1rem; } .story-review-form-bottom { align-items:stretch; } .story-review-submit { width:100%; } .story-review-login-card { align-items:flex-start; flex-wrap:wrap; } .story-review-login-link { margin-right:0; } .story-review-static-rating { font-size:.85rem; } }


/* v25: official Eitaa icon asset */
.sq-shell-social-link .sq-shell-eitaa-icon {
  display:block;
  width:27px;
  height:27px;
  object-fit:contain;
  border-radius:7px;
  flex:0 0 27px;
}


/* Footer app-install invitation: integrated as a column between About and Social. */
.sq-shell-app-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  direction: rtl;
}
.sq-shell-app-promo-main { display: contents; }
.sq-shell-bazaar-mark {
  display: block;
  flex: 0 0 auto;
  width: 158px;
  min-height: 0;
  height: auto;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sq-shell-bazaar-mark img {
  display: block;
  width: 100%;
  max-width: 158px;
  max-height: 60px;
  height: auto;
  object-fit: contain;
}
.sq-shell-app-promo-copy { min-width: 0; }
.sq-shell-app-promo-copy strong { display: block; margin-bottom: 3px; color: #fff8df; font-size: .91rem; font-weight: 950; }
.sq-shell-app-promo-copy p { max-width: 260px; margin: 0 0 7px; color: #d7e9dd; font-size: .77rem; line-height: 1.9; }
.sq-shell-footer-install-col { min-width: 0; }
.sq-shell-footer-install-col .sq-shell-footer-title { margin-bottom: 9px; }
body.dark-mode .sq-shell-bazaar-mark { border: 0; background: transparent; box-shadow: none; }
@media (max-width: 820px) {
  .sq-shell-app-promo { align-items: flex-start; gap: 7px; }
  .sq-shell-app-promo-copy { order: 0; }
  .sq-shell-bazaar-mark { order: 1; width: 148px; }
  .sq-shell-bazaar-mark img { max-width: 148px; max-height: 56px; }
  .sq-shell-app-promo-copy strong { font-size: .87rem; }
  .sq-shell-app-promo-copy p { max-width: 100%; font-size: .74rem; line-height: 1.85; }
}
