/* The site header with its panels (search, notifications, account), the message toasts and the release
   calendar. Built on the theme variables of layout/base.html (--bg, --surface, --text, --accent ...), so both
   themes follow; plain CSS, independent of the Tailwind build. */

/* ================================================================ header */
.hd {
  position: sticky; top: 0; z-index: 60; direction: rtl;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}
.hd.is-hidden { transform: translateY(-100%); }
.hd.is-scrolled { box-shadow: 0 8px 30px -18px var(--shadow-ink); }
.hd::before { content: ''; display: block; height: 2px; background: linear-gradient(90deg, var(--accent), #6aa6ff, var(--accent-2)); }
.hd-row { display: flex; align-items: center; gap: 10px; max-width: 1110px; height: 58px; margin: 0 auto; padding: 0 12px; }
.hd-logo { flex: none; display: flex; align-items: center; }
.hd-logo img { height: 30px; width: auto; }
.hd-nav { display: flex; align-items: center; gap: 2px; margin-inline-start: 10px; }
.hd-nav a {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 12px;
  color: var(--text-muted); font-size: 13px; font-weight: 700; text-decoration: none; transition: background .15s, color .15s;
}
.hd-nav a svg { width: 17px; height: 17px; }
.hd-nav a:hover { background: var(--surface-2); color: var(--text); }
.hd-nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hd-space { flex: 1; }
.hd-search {
  display: flex; align-items: center; gap: 8px; width: 240px; height: 40px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2); color: var(--text-soft); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.hd-search:hover { border-color: var(--border-strong); color: var(--text-muted); }
.hd-search svg { width: 17px; height: 17px; flex: none; }
.hd-search span { flex: 1; text-align: right; }
.hd-search kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); font: 600 11px ui-monospace, monospace; color: var(--text-soft); }
.hd-btn {
  position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.hd-btn:hover, .hd-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.hd-btn svg { width: 20px; height: 20px; }
.hd-badge {
  position: absolute; top: 5px; left: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; border: 2px solid var(--surface);
  background: var(--accent-2); color: #fff; font: 800 10px/13px 'Vazirmatn', sans-serif; text-align: center;
}
.hd-avatar {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.hd-login {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--accent-ink) !important;
  font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap;
}
.hd-login:hover { filter: brightness(1.06); }
.hd .icon-moon { display: none; }
[data-theme="dark"] .hd .icon-moon { display: block; }
[data-theme="dark"] .hd .icon-sun { display: none; }
.hd a:focus-visible, .hd button:focus-visible, .pnl a:focus-visible, .pnl button:focus-visible, .pnl input:focus-visible,
.rc a:focus-visible, .rc button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the second row on phones: the sections */
.hd-tabs { display: none; }
@media (max-width: 859px) {
  .hd-nav, .hd-search { display: none; }
  .hd-row { height: 54px; gap: 4px; }
  .hd-tabs { display: flex; gap: 6px; max-width: 1110px; margin: 0 auto; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; }
  .hd-tabs::-webkit-scrollbar { display: none; }
  .hd-tabs a {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 700; text-decoration: none;
  }
  .hd-tabs a svg { width: 15px; height: 15px; }
  .hd-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
}
@media (min-width: 860px) { .hd-btn.only-phone { display: none; } }

/* ================================================================ panels (dropdowns, and sheets on phones) */
.pnl {
  position: fixed; z-index: 1210; direction: rtl; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45), 0 0 0 1px var(--border);
}
.pnl[hidden], .pnl-bg[hidden] { display: none !important; }
.pnl-bg { position: fixed; inset: 0; z-index: 1200; background: rgba(5, 7, 12, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.pnl-bg.clear { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.pnl.drop { top: 66px; width: 360px; max-height: min(560px, calc(100vh - 90px)); animation: pnl-in .16s ease-out; }
.pnl-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.pnl-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.pnl-head button.link, .pnl-foot a { border: 0; background: none; color: var(--accent); font: 700 12px 'Vazirmatn', sans-serif; cursor: pointer; text-decoration: none; }
.pnl-body { overflow: auto; overscroll-behavior: contain; }
.pnl-foot { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; }
.pnl-empty { padding: 34px 20px; text-align: center; color: var(--text-soft); font-size: 13px; line-height: 2; }
.pnl-empty svg { display: block; width: 34px; height: 34px; margin: 0 auto 6px; opacity: .45; }
@keyframes pnl-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@media (max-width: 859px) {
  .pnl.drop { top: auto; bottom: 0; left: 0 !important; right: 0 !important; width: auto; max-height: 80vh; border-radius: 22px 22px 0 0;
              padding-bottom: env(safe-area-inset-bottom); animation: pnl-up .25s cubic-bezier(.2, .8, .2, 1); }
  .pnl.drop .pnl-head::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--border-strong); }
}
@keyframes pnl-up { from { transform: translateY(100%); } }

/* notifications */
.nt { display: flex; gap: 12px; padding: 12px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.nt:last-child { border-bottom: 0; }
.nt:hover { background: var(--surface-2); }
.nt i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--accent); }
.nt i svg { width: 17px; height: 17px; }
.nt span { flex: 1; min-width: 0; font-size: 13px; line-height: 1.8; }
.nt span b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.nt small { color: var(--text-soft); font-size: 11px; }
.nt.unread span b { font-weight: 800; }
.nt.unread::after { content: ''; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--accent-2); }
.nt-skel { height: 58px; margin: 10px 16px; border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg-soft) 50%, var(--surface-2) 70%) 0 0 / 250% 100%; animation: rc-shine 1.4s linear infinite; }

/* account menu */
.pnl.menu { width: 260px; }
.menu-who { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.menu-who b { display: block; font-size: 14px; }
.menu-who small { color: var(--text-soft); font-size: 11px; }
.menu-list { padding: 6px; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--text); font: 600 13px 'Vazirmatn', sans-serif; text-align: right; text-decoration: none; cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list svg { width: 18px; height: 18px; color: var(--text-soft); }
.menu-list hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); }
.menu-list .danger { color: #e5484d; }
.menu-list .danger svg { color: #e5484d; }

/* search */
.pnl.search { top: 12vh; left: 50%; width: min(620px, calc(100% - 24px)); max-height: 72vh; transform: translateX(-50%); animation: srch-in .18s ease-out; }
@keyframes srch-in { from { opacity: 0; transform: translate(-50%, -8px) scale(.985); } }
@media (max-width: 859px) {
  .pnl.search { top: 0; left: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; transform: none; animation: none; }
}
.srch-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.srch-bar svg { width: 20px; height: 20px; flex: none; color: var(--text-soft); }
.srch-bar input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--text); font: 600 16px 'Vazirmatn', sans-serif; outline: none; box-shadow: none; }
.srch-bar input::placeholder { color: var(--text-soft); }
.srch-bar button { flex: none; border: 0; background: var(--surface-2); color: var(--text-muted); font: 700 12px 'Vazirmatn', sans-serif; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.srch-list { list-style: none; margin: 0; padding: 6px; }
.srch-list a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.srch-list a.is-active, .srch-list a:hover { background: var(--surface-2); }
.srch-list a.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.srch-list img, .srch-list .ph { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.srch-list span { flex: 1; min-width: 0; }
.srch-list b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-list small { color: var(--text-soft); font-size: 12px; direction: ltr; unicode-bidi: plaintext; }
.srch-list mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; }
.srch-sec { padding: 12px 16px 4px; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.srch-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 16px 14px; }
.srch-chips button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); border-radius: 999px; padding: 5px 12px; font: 600 12px 'Vazirmatn', sans-serif; cursor: pointer; }
.srch-hint { display: flex; gap: 14px; justify-content: center; padding: 10px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 11px; }
.srch-hint kbd { padding: 0 5px; border-radius: 5px; border: 1px solid var(--border-strong); font: 600 10px ui-monospace, monospace; }
@media (max-width: 859px) { .srch-hint { display: none; } }
.srch-spin { width: 20px; height: 20px; margin: 26px auto; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: srch-rot .8s linear infinite; }
@keyframes srch-rot { to { transform: rotate(360deg); } }

/* ================================================================ messages as toasts */
.toasts { position: fixed; top: 76px; left: 50%; z-index: 1300; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); transform: translateX(-50%); direction: rtl; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; pointer-events: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .45);
  font-size: 13px; line-height: 1.8; animation: toast-in .25s ease-out;
}
.toast::before { content: ''; flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: var(--accent); }
.toast.error::before { background: #e5484d; } .toast.warning::before { background: #f59e0b; } .toast.success::before { background: #10b981; }
.toast span { flex: 1; }
.toast button { flex: none; border: 0; background: none; color: var(--text-soft); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ================================================================ release calendar */
.rc { direction: rtl; color: var(--text); }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rc-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.rc-title::before { content: ''; width: 6px; height: 20px; border-radius: 6px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.rc-more { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12px; font-weight: 800; text-decoration: none; }
.rc-more svg { width: 15px; height: 15px; }

/* the week strip (home) */
.rc-strip { display: grid; grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.rc-strip::-webkit-scrollbar { display: none; }
.rc-daybtn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px 12px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface); color: var(--text-muted); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.rc-daybtn:active { transform: scale(.97); }
.rc-daybtn small { font-size: 11px; font-weight: 700; }
.rc-daybtn b { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.3; }
.rc-daybtn .n { position: absolute; bottom: 5px; display: flex; gap: 3px; }
.rc-daybtn .n i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.rc-daybtn.is-empty { opacity: .55; }
.rc-daybtn.is-today small { color: var(--accent); }
.rc-daybtn[aria-pressed="true"] { border-color: transparent; background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: var(--accent-ink); }
.rc-daybtn[aria-pressed="true"] b, .rc-daybtn[aria-pressed="true"] small { color: var(--accent-ink); }
.rc-daybtn[aria-pressed="true"] .n i { background: var(--accent-ink); }

.rc-cards { display: flex; gap: 12px; overflow-x: auto; padding: 14px 2px 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rc-card {
  position: relative; flex: none; width: 150px; scroll-snap-align: start; border-radius: 16px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s;
}
.rc-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px var(--shadow-ink); }
.rc-card img, .rc-card .ph { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface-2); }
.rc-card-body { padding: 8px 10px 10px; }
.rc-card-body b { display: block; font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-card-body span { display: block; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-time {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: rgba(8, 10, 15, .72); color: #fff; font-size: 11px; font-weight: 800; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.rc-time.out { background: #10b981; }
.rc-soon { display: block; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--accent-2); }
.rc-soon:empty { display: none; }
.rc-star { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-2); color: #fff; font-size: 12px; font-style: normal; }
.rc-none { padding: 22px 12px; text-align: center; color: var(--text-soft); font-size: 13px; border: 1px dashed var(--border-strong); border-radius: 16px; margin-top: 14px; }

/* the full calendar (schedule page) */
.rc-hero {
  position: relative; overflow: hidden; margin: 16px 0 18px; padding: 22px 22px 20px; border-radius: 24px; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--accent) 80%, #000) 0%, #11151f 55%, color-mix(in srgb, var(--accent-2) 55%, #000) 120%);
}
.rc-hero h1 { margin: 0; font-size: 22px; font-weight: 800; }
.rc-hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .72); font-size: 13px; }
.rc-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rc-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.rc-stat { padding: 8px 14px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
.rc-stat b { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.rc-stat small { color: rgba(255, 255, 255, .7); font-size: 11px; }
.rc-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.rc-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.rc-seg button { border: 0; border-radius: 9px; padding: 6px 14px; background: none; color: rgba(255, 255, 255, .75); font: 700 12px 'Vazirmatn', sans-serif; cursor: pointer; }
.rc-seg button[aria-pressed="true"] { background: #fff; color: #11151f; }
.rc-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.rc-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.rc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 959px) { .rc-layout { grid-template-columns: minmax(0, 1fr); } }
.rc-grid { border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface); }
.rc-grid-head, .rc-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rc-grid-head div { padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 800; color: var(--text-soft); background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.rc-cell {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 108px; padding: 8px; border: 0; border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: right; cursor: pointer; transition: background .15s;
}
.rc-week .rc-cell:last-child { border-left: 0; }
.rc-week:last-child .rc-cell { border-bottom: 0; }
.rc-cell:hover { background: var(--surface-2); }
.rc-cell.is-past { background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
.rc-cell.is-past .rc-cell-day { opacity: .5; }
.rc-cell-day { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 800; }
.rc-cell-day small { font-size: 10px; font-weight: 700; color: var(--text-soft); }
.rc-cell.is-today .rc-cell-day b { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.rc-cell[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
.rc-thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-thumbs img, .rc-thumbs .ph { width: 30px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.rc-thumbs em { display: grid; place-items: center; width: 30px; height: 40px; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 800; font-style: normal; }
.rc-cell .rc-dot { display: none; }
@media (max-width: 599px) {
  .rc-cell { min-height: 58px; padding: 6px 4px; align-items: center; }
  .rc-cell-day { justify-content: center; font-size: 13px; }
  .rc-cell-day small, .rc-thumbs { display: none; }
  .rc-cell .rc-dot { display: flex; gap: 2px; justify-content: center; }
  .rc-cell .rc-dot i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
}

.rc-side { position: sticky; top: 76px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.rc-side-head { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.rc-side-head b { display: block; font-size: 16px; font-weight: 800; }
.rc-side-head small { color: var(--text-soft); font-size: 12px; }
.rc-list { padding: 6px; }
.rc-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; color: var(--text); text-decoration: none; }
.rc-item:hover { background: var(--surface-2); }
.rc-item img, .rc-item .ph { flex: none; width: 46px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.rc-item-text { flex: 1; min-width: 0; }
.rc-item-text b { display: block; font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-item-text span { display: block; font-size: 12px; color: var(--text-muted); }
.rc-item-when { flex: none; text-align: left; }
.rc-item-when time { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-tag { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; font-style: normal; background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.rc-tag:empty { display: none; }
.rc-tag.out { background: color-mix(in srgb, #10b981 16%, transparent); color: #10b981; }
.rc-item .rc-star { position: static; flex: none; width: 20px; height: 20px; font-size: 11px; }
.rc-agenda { display: flex; flex-direction: column; gap: 14px; }
.rc-agenda-day { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.rc-agenda-day h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 800; color: var(--text); }
.rc-agenda-day h3 small { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.rc-agenda-day h3 em { margin-inline-start: auto; font-style: normal; font-size: 11px; color: var(--accent); }
@keyframes rc-shine { to { background-position: -250% 0; } }

@media (prefers-reduced-motion: reduce) {
  .hd, .pnl, .toast, .rc-card, .rc-daybtn { transition: none !important; animation: none !important; }
}

/* ================================================================ home: the sliders
   A plain crossfade: the next slide fades in on top, and the one it covers waits until then before it goes. */
.cx-slide { opacity: 0; z-index: 0; transition: opacity .7s ease .7s; }
.cx-slide.is-on { opacity: 1; z-index: 10; transition: opacity .7s ease; }
@media (prefers-reduced-motion: reduce) { .cx-slide, .cx-slide.is-on { transition: none; } }

/* The desktop slide: only the slanted right edge (beside the Telegram and account tiles) is cut: 781px at the top of
   the 416px art band (y = 38px) to 841px at its bottom, the same line carried on far above and below. Top, bottom and
   left stay open, so a transparent slide image can break out of the band. */
.cx-trap { clip-path: polygon(-400px -400px, 717.8px -400px, 905.3px 900px, -400px 900px); }

/* ================================================================ shared page parts
   The pieces the pages are built from (home, categories, series page): page width, section headings, cards,
   buttons, segmented controls, the series cover card and its grid, genre chips, the pager. */
.ui-page { direction: rtl; color: var(--text); padding-bottom: 56px; }
.ui-wrap { max-width: 1110px; margin: 0 auto; padding: 0 16px; }
@media (max-width: 679px) { .ui-wrap { padding: 0 12px; } }
.ui-page a:focus-visible, .ui-page button:focus-visible, .ui-page input:focus-visible, .ui-page select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* section headings */
.ui-sec { margin-top: 36px; }
.ui-sec-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.ui-sec-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 800; color: var(--text); }
.ui-sec-title::before { content: ''; flex: none; width: 6px; height: 22px; border-radius: 6px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.ui-sec-title small { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.ui-sec-sub { margin: -6px 0 14px; color: var(--text-muted); font-size: 13px; line-height: 1.9; }
.ui-more { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 800; text-decoration: none; }
.ui-more:hover { color: var(--accent-2); }
.ui-more svg { width: 16px; height: 16px; }
@media (max-width: 679px) { .ui-sec { margin-top: 28px; } .ui-sec-title { font-size: 16px; } }

/* buttons, cards, segmented controls */
.ui-link { padding: 0; border: 0; background: none; color: var(--accent); font: 700 12px 'Vazirmatn', sans-serif; cursor: pointer; }
.ui-link:hover { color: var(--accent-2); }
.ui-btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text);
  font: 800 13px 'Vazirmatn', sans-serif; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: filter .15s, border-color .15s, background .15s, color .15s, transform .1s;
}
.ui-btn:hover { border-color: var(--accent); }
.ui-btn:active { transform: scale(.97); }
.ui-btn:disabled { opacity: .45; cursor: default; transform: none; border-color: var(--border-strong); }
.ui-btn svg { flex: none; width: 18px; height: 18px; }
.ui-btn.is-primary {
  border-color: transparent; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--accent) 75%, transparent);
}
.ui-btn.is-primary:hover { filter: brightness(1.06); }
.ui-btn.is-primary:disabled { border-color: transparent; box-shadow: none; }
.ui-btn.is-lg { height: 54px; padding: 0 22px 0 26px; font-size: 15px; }
.ui-btn.is-lg span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.4; }
.ui-btn.is-lg small { max-width: 230px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-weight: 600; opacity: .8; }
.ui-btn.is-lg svg { width: 20px; height: 20px; }
.ui-btn-bar { position: absolute; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--accent-ink) 50%, transparent); }
.ui-btn.is-on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.ui-btn.is-icon { width: 44px; padding: 0; }
.ui-btn.is-sm { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 12px; }
.ui-card { border: 1px solid var(--border); border-radius: 20px; background: var(--surface); overflow: hidden; }
.ui-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ui-card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.ui-card-head h2::before { content: ''; width: 6px; height: 20px; border-radius: 6px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.ui-card-head h2 small { color: var(--text-soft); font-size: 12px; font-weight: 700; }
.ui-none { margin: 0; padding: 26px 16px; text-align: center; color: var(--text-soft); font-size: 13px; line-height: 2; }
.ui-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.ui-seg button { padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--text-muted); font: 700 12px 'Vazirmatn', sans-serif; cursor: pointer; }
.ui-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px var(--shadow-ink); }
.ui-seg a { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 9px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ui-seg a:hover { color: var(--text); }
.ui-seg a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px var(--shadow-ink); }

/* breadcrumbs */
.ui-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.ui-crumbs li { display: flex; align-items: center; gap: 6px; }
.ui-crumbs a { color: var(--text-muted); text-decoration: none; }
.ui-crumbs a:hover { color: var(--accent); }
.ui-crumbs svg { width: 13px; height: 13px; opacity: .7; }

/* tabs (links to the sections of a page) */
.ui-tabs { display: flex; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); scroll-margin-top: 76px; }
.ui-tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px;
  color: var(--text-muted); font-size: 14px; font-weight: 800; text-decoration: none; transition: color .15s;
}
.ui-tabs a:hover { color: var(--text); }
.ui-tabs em { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-style: normal; }
.ui-tabs a[aria-current="page"] { color: var(--text); }
.ui-tabs a[aria-current="page"]::after {
  content: ''; position: absolute; right: 10px; left: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.ui-tabs a[aria-current="page"] em { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 679px) { .ui-tabs a { flex: 1; justify-content: center; } }

/* the series cover card (3:4) and its grid */
.ui-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px 16px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 899px) { .ui-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; } }
@media (max-width: 679px) { .ui-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; } }
.sc { position: relative; min-width: 0; }
.sc-cover {
  position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 16px; background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--border); transition: transform .18s ease, box-shadow .18s ease;
}
.sc-cover img, .sc-cover .ph { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.sc:hover .sc-cover { transform: translateY(-3px); box-shadow: 0 18px 34px -20px var(--shadow-ink), 0 0 0 1px var(--border-strong); }
.sc:hover .sc-cover img { transform: scale(1.04); }
.sc-badge {
  position: absolute; top: 8px; right: 8px; max-width: calc(100% - 16px); padding: 2px 8px; overflow: hidden; border-radius: 999px;
  background: rgba(8, 10, 15, .72); color: #fff; font-size: 11px; font-weight: 800; font-style: normal; white-space: nowrap; text-overflow: ellipsis;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sc-badge.is-hot { background: var(--accent-2); }
.sc-title {
  display: -webkit-box; margin-top: 8px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--text); font-size: 14px; font-weight: 800; line-height: 1.6; text-decoration: none;
}
.sc-title:hover { color: var(--accent); }
.sc-meta { display: flex; flex-wrap: wrap; gap: 0 8px; margin-top: 1px; color: var(--text-soft); font-size: 12px; }
.sc-meta a { color: inherit; text-decoration: none; }
.sc-meta a:hover { color: var(--accent); }
@media (max-width: 679px) {
  .sc-cover { border-radius: 12px; }
  .sc-badge { top: 6px; right: 6px; padding: 1px 6px; font-size: 10px; }
  .sc-title { margin-top: 6px; font-size: 13px; }
  .sc-meta { font-size: 11px; }
}

/* a row of cover cards; on narrow screens it scrolls sideways */
.ui-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 5 * 16px) / 6); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 899px) {
  .ui-row { grid-auto-columns: 132px; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ui-row::-webkit-scrollbar { display: none; }
  .ui-row > * { scroll-snap-align: start; }
}
@media (max-width: 679px) { .ui-row { grid-auto-columns: 118px; margin: 0 -12px; padding: 2px 12px 8px; } }

/* genre chips */
.ui-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.ui-chips::-webkit-scrollbar { display: none; }
.ui-chips a {
  flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 700; text-decoration: none; transition: color .15s, border-color .15s;
}
.ui-chips a:hover { border-color: var(--border-strong); color: var(--text); }
.ui-chips a[aria-current="page"] { border-color: transparent; background: var(--accent); color: var(--accent-ink); }

/* the pager */
.ui-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.ui-pager a, .ui-pager span {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text-muted);
  font-size: 14px; font-weight: 800; text-decoration: none; transition: border-color .15s, color .15s;
}
.ui-pager a:hover { border-color: var(--accent); color: var(--text); }
.ui-pager [aria-current="page"] { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.ui-pager .is-gap { min-width: 18px; padding: 0; border: 0; background: none; }
.ui-pager .is-off { opacity: .35; }
.ui-pager svg { width: 16px; height: 16px; }
.ui-pager-info { margin: 10px 0 0; text-align: center; color: var(--text-soft); font-size: 12px; }
@media (max-width: 679px) { .ui-pager .ui-pager-label { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ui-btn, .sc-cover, .sc-cover img { transition: none !important; }
}
