/* Member area, sign-in pages and shared public chrome. Works in browsers and in the Telegram Mini App. */

/* ---- header: logo and title aligned, safe areas for phones / Telegram ---- */
.pub-header { padding-top: env(safe-area-inset-top); }
.pub-header-inner { min-height: 72px; padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); }
.pub-brand { align-items: center; gap: 14px; }
.pub-logo { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; }
.pub-logo img { width: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.pub-brand-text { justify-content: center; line-height: 1.25; }
.pub-brand-text strong { font-size: 18px; }
.pub-brand-text small { margin-top: 2px; }
.pub-main { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.pub-wrap { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

/* ---- footer with social links ---- */
.pub-footer-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.social-row { display: flex; gap: 8px; }
.social-row a { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--line-2); color: var(--ink-2); transition: background .15s, color .15s, transform .15s; }
.social-row a:hover { background: var(--blue); color: #fff; transform: translateY(-1px); text-decoration: none; }
.ic-fill { fill: currentColor; stroke: none; width: 18px; height: 18px; }

/* ---- bell ---- */
.ws-bell { position: relative; }
.ws-bell summary { position: relative; }
.bell-dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #e5484d;
  color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.bell-body { width: min(360px, calc(100vw - 24px)); right: 0; padding: 0; overflow: hidden; }
.bell-title { padding: 12px 16px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.bell-item { display: grid; gap: 2px; padding: 11px 16px; color: var(--ink); border-bottom: 1px solid var(--line-2); font-size: 14px; }
.bell-item span { color: var(--muted); font-size: 13px; }
.bell-item:hover { background: var(--hover); text-decoration: none; }
.bell-item.is-unread { border-left: 3px solid var(--blue); background: var(--blue-50); }
.bell-item.is-action { border-left: 3px solid #eb9a34; }
.bell-empty { padding: 18px 16px; margin: 0; color: var(--muted); }
.bell-all { display: block; text-align: center; padding: 11px; font-weight: 600; }

/* ---- sign-in pages ---- */
.auth-wrap { min-height: calc(100vh - 260px); display: flex; align-items: center; justify-content: center; padding: 12px 0 28px; }
.auth-card { width: 100%; max-width: 460px; padding: 34px 32px 28px; border-radius: 20px; gap: 16px;
  box-shadow: 0 18px 50px rgba(28, 39, 72, .12); }
.auth-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.auth-mark .badge-ic { width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1c4789, #4a6cf7); color: #fff; }
.auth-mark .badge-ic .ic { width: 22px; height: 22px; }
.auth-card h1 { font-size: 26px; }
.auth-card .input { height: 48px; border-radius: 12px; font-size: 16px; }
.auth-card .input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74, 108, 247, .18); outline: none; }
.auth-card .btn-primary { height: 50px; border-radius: 12px; font-size: 16px; background: linear-gradient(135deg, #1c4789, #3b63e0);
  box-shadow: 0 8px 20px rgba(28, 71, 137, .28); }
.auth-card .btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, #1c4789, #3b63e0); }
.auth-card .btn-cta { background: linear-gradient(135deg, #f0553f, #d9483b); box-shadow: 0 8px 20px rgba(217, 72, 59, .28); }
.auth-links a { font-weight: 600; }
.auth-alt { border-top: 1px solid var(--line-2); padding-top: 14px; display: grid; gap: 10px; text-align: center; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- member panel: left sub-menu + content ---- */
.cab-head { margin-bottom: 22px; }
.cab-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.cab-side { position: sticky; top: 92px; display: grid; gap: 4px; padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); }
.cab-side a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.cab-side a .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.cab-side a:hover { background: var(--hover); text-decoration: none; }
.cab-side a.is-active { background: var(--blue-50); color: var(--blue-600); }
.cab-side a.is-active .ic { color: var(--blue); }
.cab-side .side-badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--muted-bg); color: var(--muted-fg); }
.cab-main { min-width: 0; display: grid; gap: 16px; }
.cab-panel { display: grid; gap: 16px; }
.js .cab-panel { display: none; }
.js .cab-panel.is-active { display: grid; }
.cab-panel > .card { margin: 0; }
.panel-title { font-size: 20px; color: var(--brand-navy); margin: 0 0 2px; }

/* features */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.feature { position: relative; display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); }
.feature:hover { text-decoration: none; border-color: var(--line-strong); }
a.feature:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.feature .f-ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-50); color: var(--blue); }
.feature .f-ic .ic { width: 21px; height: 21px; }
.feature h3 { font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }
.feature.is-locked { background: var(--surface-2); }
.feature.is-locked .f-ic { background: var(--muted-bg); color: var(--muted); }
.feature .f-tag { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; color: var(--muted-fg); }
.feature .f-tag .ic { width: 13px; height: 13px; }
.feature .f-tag.is-live { color: var(--success); }

/* visitor call to action */
.join-hero { display: grid; gap: 14px; padding: 26px; color: #fff; border: 0; background: linear-gradient(135deg, #0c2247, #1d3f75 60%, #3b63e0); }
.join-hero h2 { color: #fff; font-size: 24px; }
.join-hero p { margin: 0; color: #cfdcf5; max-width: 560px; }
.join-hero .btn { width: fit-content; background: linear-gradient(135deg, #f0553f, #d9483b); color: #fff; height: 46px; padding: 0 22px; }

/* telegram card */
.tg-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.tg-ic { width: 54px; height: 54px; border-radius: 16px; background: #229ed9; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.tg-ic .ic { width: 28px; height: 28px; }
.tg-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn-tg { background: #229ed9; color: #fff; }
.btn-tg:hover { background: #1b8bc0; }
.btn[aria-disabled=true], .btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* notifications page */
.note-list { display: grid; }
.note-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.note-row:last-child { border-bottom: 0; }
.note-row:hover { text-decoration: none; }
.note-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); margin-top: 7px; flex: none; }
.note-row.is-new .note-dot { background: var(--blue); }
.note-row.is-action .note-dot { background: #eb9a34; }
.note-row p { margin: 2px 0 0; color: var(--muted); }

/* ---- tablet / phone / Telegram ---- */
@media (max-width: 900px) {
  .cab-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cab-side { position: sticky; top: calc(72px + env(safe-area-inset-top)); z-index: 15; display: flex; overflow-x: auto; gap: 6px; padding: 8px;
    scrollbar-width: none; border-radius: 14px; }
  .cab-side::-webkit-scrollbar { display: none; }
  .cab-side a { white-space: nowrap; padding: 9px 13px; flex: none; }
  .cab-side .side-badge { display: none; }
}
@media (max-width: 600px) {
  .pub-header-inner { min-height: 64px; padding-left: 14px; padding-right: 14px; gap: 6px; }
  .pub-logo { width: 44px; height: 44px; }
  .pub-brand-text strong { font-size: 16px; }
  .pub-wrap { padding-left: 14px; padding-right: 14px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 18px; }
  .auth-wrap { min-height: auto; padding-top: 4px; }
  .cab-head { gap: 12px; }
  .cab-head h1 { font-size: 21px; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-footer-in { justify-content: center; text-align: center; }
  .join-hero { padding: 20px; }
  .tg-card { grid-template-columns: minmax(0, 1fr); }
  .cab-side { top: calc(64px + env(safe-area-inset-top)); }
}
.is-tg .pub-footer { display: none; }
.is-tg .pub-header { position: static; }
/* Inside Telegram the header scrolls away, so the menu must stick to the very top (not 64px down, where it covered the page) */
.is-tg .cab-side { top: calc(8px + env(safe-area-inset-top)); }
@media (min-width: 901px) { .is-tg .cab-side { top: 16px; } }
.is-tg, .is-tg body { max-width: 100%; overflow-x: clip; } /* clip, not hidden: hidden would break the sticky menu */
.is-tg .pub-main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.is-tg .cab-panel, .is-tg [id] { scroll-margin-top: 72px; }
.is-tg h1, .is-tg h2, .is-tg h3, .is-tg .card-title, .is-tg dd, .is-tg .chip { overflow-wrap: anywhere; }
.is-tg img, .is-tg svg, .is-tg video { max-width: 100%; }
.is-tg .table-scroll { max-width: 100%; }

/* ---- profile completeness ---- */
.complete-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.complete-ring { --pct: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--pct) * 1%), var(--line-2) 0); position: relative; }
.complete-ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.complete-ring span { position: relative; font-weight: 700; font-size: 18px; color: var(--ink); }
.complete-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.complete-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4a6cf7, #1c4789); }
.nudge { border: 0; border-radius: 20px; padding: 28px; max-width: 420px; width: calc(100% - 32px); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 70px rgba(12, 34, 71, .35); text-align: center; }
.nudge::backdrop { background: rgba(12, 34, 71, .55); }
.nudge form { display: grid; gap: 12px; justify-items: center; }
.nudge h2 { font-size: 20px; }
.nudge p { margin: 0; }
.nudge-actions { display: grid; gap: 8px; width: 100%; margin-top: 6px; }
@media (max-width: 600px) { .complete-card { grid-template-columns: minmax(0, 1fr); justify-items: start; } }

/* notifications: read tick */
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.note-row .note-main { flex: 1; min-width: 0; }
.note-row .note-main a { color: var(--ink); }
.note-check, .note-done { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.note-check { border: 1.5px solid var(--blue); background: transparent; color: var(--blue); cursor: pointer; }
.note-check:hover, .note-check:focus-visible { background: var(--blue); color: #fff; }
.note-done { color: var(--muted); }
.note-check .ic, .note-done .ic { width: 17px; height: 17px; }
.bell-read { border-top: 1px solid var(--line-2); }
.bell-read button { width: 100%; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; border: 0; background: transparent;
  color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.bell-read button:hover { background: var(--hover); }
.bell-read .ic { width: 16px; height: 16px; }

.tg-steps { margin: 10px 0 4px; padding-left: 20px; display: grid; gap: 3px; }
