/* ===== مجتمع أسيرا — RTL design system ===== */
:root {
  /* Calm premium indigo palette (names kept for compatibility) */
  --teal: #5b5bd6;       /* primary */
  --teal-700: #4f46e5;   /* primary strong / hover */
  --teal-50: #eef0fc;    /* light tint */
  --navy: #1e2147;       /* deep indigo ink (headings) */
  --navy-600: #3a3f63;   /* secondary text */
  --ink: #20233f;        /* body text */
  --muted: #6b7191;      /* muted */
  --line: #e7e8f3;       /* borders */
  --bg: #f6f7fc;         /* soft cool background */
  --card: #ffffff;
  --accent: #f59e0b;     /* warm amber accent */
  --green: #16a34a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,32,46,.05), 0 8px 24px rgba(16,32,46,.06);
  --max: 1140px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;  /* kill any residual horizontal scroll without breaking position:sticky */
  font-family: "IBM Plex Sans Arabic", "Cairo", system-ui, "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: "Cairo", sans-serif; line-height: 1.35; color: var(--navy); }
img { max-width: 100%; height: auto; }
.container { width: min(var(--max), 92%); margin-inline: auto; }
.container-wide { width: min(1900px, 96%); margin-inline: auto; }
.muted { color: var(--muted); }

.skip-link {
  /* Off-screen vertically (fixed → never widens the document; right:-999px on an
     RTL page expanded scrollWidth and caused page-wide horizontal overflow). */
  position: fixed; inset-inline-start: 12px; top: 0; background: var(--teal); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 8px; z-index: 1000;
  transform: translateY(-130%); transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ===== Header ===== */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: .9rem; padding: .55rem 0; flex-wrap: wrap; width: min(1820px, 96%); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-family: "Cairo";
  font-weight: 800; font-size: 1.2rem;
}
.brand-logo { width: 36px; height: 36px; display: block; flex: 0 0 auto; }
.brand-text { font-size: 1.15rem; }
.search { flex: 1 1 170px; min-width: 150px; max-width: 360px; display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; position: relative; }
.search input { border-radius: 999px; }

/* Live search dropdown (instant people results under the search box) */
.ls-dropdown { position: absolute; top: calc(100% + 7px); inset-inline: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(16,32,46,.18); z-index: 200; overflow: hidden; max-height: 70vh; overflow-y: auto; }
.ls-dropdown[hidden] { display: none; }
.ls-people { list-style: none; margin: 0; padding: .3rem; }
.ls-person { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 10px; color: var(--ink); }
.ls-person:hover { background: var(--teal-50); text-decoration: none; }
.ls-person img, .ls-person .avatar-fallback { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: .9rem; }
.ls-person .avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; }
.ls-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ls-name { font-weight: 700; display: flex; align-items: center; gap: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-sub { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-empty { padding: .9rem 1rem; font-size: .9rem; }
/* Recent searches history */
.lsr-head { padding: .55rem .9rem .35rem; font-size: .78rem; font-weight: 700; color: var(--muted); }
.ls-recent { display: flex; align-items: center; gap: .55rem; padding: .45rem .7rem; margin: 0 .3rem; border-radius: 10px; cursor: pointer; }
.ls-recent:hover { background: var(--teal-50); }
.lsr-ico { opacity: .6; font-size: .9rem; flex: 0 0 auto; }
.lsr-q { flex: 1; min-width: 0; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsr-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .9rem; padding: .25rem .4rem; border-radius: 8px; flex: 0 0 auto; }
.lsr-x:hover { background: #fde2e2; color: #dc2626; }
.ls-all { display: block; padding: .7rem 1rem; border-top: 1px solid var(--line); font-weight: 700; color: var(--teal-700); background: var(--bg); }
.ls-all:hover { background: var(--teal-50); text-decoration: none; }

/* Unified search results page */
.search-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 1.4rem; overflow-x: auto; }
.search-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--navy-600); font-weight: 700; font-size: .9rem; white-space: nowrap; flex: 0 0 auto; }
.search-tab:hover { background: var(--teal-50); text-decoration: none; }
.search-tab.active { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }
.search-tab .st-count { font-size: .78rem; opacity: .85; }
.search-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 1.6rem 0 .7rem; }
.search-sec-head h2 { margin: 0; font-size: 1.15rem; }
.search-sec-head .see-all { font-weight: 700; color: var(--teal-700); font-size: .9rem; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .7rem; }
.person-card { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); }
.person-card:hover { text-decoration: none; border-color: var(--teal); transform: translateY(-1px); transition: .15s; }
.person-card img, .person-card .avatar-fallback { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: 1.1rem; }
.person-card .avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; }
.person-card .pc-meta { min-width: 0; flex: 1; }
.person-card .pc-name { font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: .25rem; }
.person-card .pc-sub { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-reels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.main-nav { margin-inline: auto; }
.search input { flex: 1; border: 0; background: transparent; padding: .55rem 1rem; font: inherit; outline: none; }
.search button { border: 0; background: transparent; padding: 0 .9rem; cursor: pointer; font-size: 1rem; }
.main-nav { display: flex; gap: 1.1rem; }
.main-nav a { color: var(--navy-600); font-weight: 600; }
.main-nav a.active { color: var(--teal-700); position: relative; }
.main-nav a.active::after { content: ""; position: absolute; inset-inline: 0; bottom: -6px; height: 2px; background: var(--teal); border-radius: 2px; }
.auth { display: flex; align-items: center; gap: .6rem; }
.avatar-link img, .avatar-fallback { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
/* Header profile avatar — clean, well-sized circle with a subtle ring */
.header-avatar { display: inline-flex; flex: 0 0 auto; border-radius: 50%; line-height: 0; transition: box-shadow .15s; }
.header-avatar img, .header-avatar .avatar-fallback {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: center;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(16,32,46,.14);
}
.header-avatar:hover img, .header-avatar:hover .avatar-fallback { box-shadow: 0 0 0 2px var(--teal), 0 2px 8px rgba(91,91,214,.3); }
.avatar-fallback { display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); font-weight: 700; }
.inline-form { display: inline; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }

/* Mobile hamburger + slide-in nav drawer */
.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; padding: 9px; border: 0; background: transparent; border-radius: 11px; cursor: pointer; flex: none; }
.nav-toggle span { display: block; height: 2.5px; width: 100%; background: var(--navy); border-radius: 2px; }
.nav-toggle:hover { background: var(--teal-50); }
.nav-drawer { position: fixed; inset: 0; z-index: 200; background: rgba(15,18,40,.45); }
.nav-drawer[hidden] { display: none; }
body.nav-open { overflow: hidden; }
.nav-drawer-sheet { position: absolute; inset-block: 0; inset-inline-start: 0; width: 84%; max-width: 320px; background: #fff; box-shadow: 0 0 40px rgba(0,0,0,.35); display: flex; flex-direction: column; animation: ndIn .22s ease; }
@keyframes ndIn { from { opacity: .3; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.nds-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.nd-close { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; }
.nd-links { display: flex; flex-direction: column; padding: .5rem; overflow-y: auto; gap: 1px; }
.nd-links a, .nd-links button { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-radius: 12px; color: var(--navy); font-weight: 600; font-size: 1rem; background: none; border: 0; cursor: pointer; text-align: start; width: 100%; font-family: inherit; }
.nd-links a:hover, .nd-links button:hover { background: var(--teal-50); text-decoration: none; }
.nd-logout-form { margin-top: .4rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.nd-logout-form button { color: #e11d48; }
.nd-links .pill { margin-inline-start: auto; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: .46rem .95rem; border-radius: 10px; font-weight: 700; font-size: .9rem; line-height: 1.4; cursor: pointer; border: 1px solid transparent; transition: background .14s, box-shadow .14s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-700); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--navy); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1.05rem; }

/* ===== Messages ===== */
.messages { list-style: none; padding: 0; margin: 1rem 0 0; }
.msg { padding: .7rem 1rem; border-radius: 10px; margin-bottom: .5rem; border: 1px solid var(--line); background: var(--card); }
.msg-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.msg-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ===== Breadcrumbs ===== */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin: 1rem 0; }
.breadcrumbs a { color: var(--muted); }

/* ===== Layout grids ===== */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; margin: 1rem 0 3rem; align-items: start; }
.layout-narrow { max-width: 760px; margin: 1.5rem auto 3rem; }
/* Sidebar stays pinned beside the scrolling main column (matches the feed rails).
   max-height + overflow keeps a tall sidebar reachable instead of clipping it. */
.sidebar { position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 880px){ .layout { grid-template-columns: 1fr; } .sidebar { order: 2; position: static; max-height: none; overflow: visible; } }

/* ===== Cards ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.sidebar .card { margin-bottom: 1.2rem; }
.sidebar h3 { margin-top: 0; font-size: 1rem; }

/* ===== Hero ===== */
.hero { background: linear-gradient(135deg, var(--navy), var(--teal-700)); color: #fff; border-radius: 20px; padding: 2.4rem; margin: 1.5rem 0; }
.hero h1 { color: #fff; font-size: 2rem; margin: 0 0 .6rem; }
.hero p { color: #d7e3e1; max-width: 60ch; font-size: 1.08rem; }
.hero .btn-primary { background: #fff; color: var(--teal-700); }
.hero-actions { margin-top: 1.3rem; display: flex; gap: .7rem; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.stat-row { display: flex; gap: 2rem; margin-top: 1.6rem; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.5rem; font-family: "Cairo"; }
.stat span { font-size: .9rem; color: #bcd1ce; }

/* ===== Professional landing page ===== */
.lp-hero { position: relative; overflow: hidden; padding: 3rem 2.6rem; text-align: center; }
.lp-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% -20%, rgba(245,158,11,.22), transparent 55%); pointer-events: none; }
.lp-hero > * { position: relative; z-index: 1; }
.lp-eyebrow { display: inline-block; background: rgba(255,255,255,.14); color: #fff; padding: .35rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 700; margin-bottom: 1rem; }
.lp-hero h1 { font-size: 2.4rem; line-height: 1.25; max-width: 22ch; margin-inline: auto; }
.lp-lead { color: #e2e8f5 !important; max-width: 62ch !important; margin-inline: auto; font-size: 1.12rem !important; line-height: 1.9; }
.lp-hero .hero-actions { justify-content: center; }
.lp-hero .stat-row { justify-content: center; gap: 3rem; }

.lp-about { text-align: center; max-width: 760px; margin: 2.6rem auto; }
.lp-about h2 { font-size: 1.7rem; margin-bottom: .8rem; }
.lp-about p { color: var(--navy-600); font-size: 1.12rem; line-height: 2; }
.lp-about b { color: var(--teal-700); }

.lp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin: 2rem 0; }
.lp-feat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.6rem; transition: transform .15s, box-shadow .15s, border-color .15s; }
.lp-feat:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(30,33,71,.08); border-color: var(--teal); }
.lp-feat-ico { width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.7rem; background: var(--teal-50); border-radius: 14px; margin-bottom: 1rem; }
.lp-feat h3 { font-size: 1.15rem; margin: 0 0 .5rem; color: var(--navy); }
.lp-feat p { color: var(--muted); line-height: 1.85; margin: 0; }

.lp-steps { text-align: center; margin: 3rem 0 2rem; }
.lp-steps > h2 { font-size: 1.7rem; margin-bottom: 1.6rem; }
.lp-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; }
.lp-step { padding: 1rem; }
.lp-step-n { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto .9rem; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-size: 1.4rem; font-weight: 800; }
.lp-step h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
.lp-step p { color: var(--muted); margin: 0; line-height: 1.8; }

.lp-cta { background: linear-gradient(135deg, var(--navy), var(--teal-700)); color: #fff; border-radius: 20px; padding: 2.8rem 2rem; text-align: center; margin: 2.5rem 0 1.5rem; }
.lp-cta h2 { color: #fff; font-size: 1.8rem; margin: 0 0 .6rem; }
.lp-cta p { color: #d7e3e1; max-width: 52ch; margin: 0 auto 1.6rem; font-size: 1.08rem; }
.lp-cta-btn { background: #fff; color: var(--teal-700); font-weight: 800; }
.lp-cta-btn:hover { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  .lp-hero { padding: 2.2rem 1.4rem; }
  .lp-hero h1 { font-size: 1.8rem; }
  .lp-hero .stat-row { gap: 1.6rem; }
}

/* ===== Question / post list items ===== */
.q-item { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-stats { display: flex; flex-direction: column; gap: .4rem; min-width: 64px; text-align: center; }
.q-stat { font-size: .8rem; color: var(--muted); }
.q-stat b { display: block; font-size: 1.1rem; color: var(--navy); font-family: "Cairo"; }
.q-stat.answered { background: var(--green); color: #fff; border-radius: 8px; padding: .15rem; }
.q-stat.answered b { color: #fff; }
.q-title { font-size: 1.12rem; margin: 0 0 .3rem; }
.q-title a { color: var(--navy); }
.q-excerpt { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.q-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }

/* ===== Tags / pills ===== */
.tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.tag { background: var(--teal-50); color: var(--teal-700); padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.tag:hover { background: #ccfbf1; text-decoration: none; }
.cat-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--navy); color: #fff; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; }
.badge-verified, .verified-seal { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, #1d9bf0, #0c7abf); color: #fff; font-size: .66rem; font-weight: 900; vertical-align: middle; box-shadow: 0 1px 3px rgba(12,122,191,.4); margin-inline-start: .15rem; }
.verified-seal { width: 22px; height: 22px; font-size: .8rem; }
/* Team verification = a GREEN seal next to the name (the "فريق أسيرا" label lives in the info card). */
.badge-verified.verified-team, .verified-seal.verified-team { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 1px 4px rgba(5,150,105,.5); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .5rem .9rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--teal-700); border-color: var(--teal); }
.tabs a:hover { text-decoration: none; }

/* ===== Category grid ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: block; }
.cat-card:hover { border-color: var(--teal); text-decoration: none; box-shadow: var(--shadow); }
.cat-icon { font-size: 1.6rem; }
.cat-card h3 { margin: .4rem 0 .2rem; font-size: 1.05rem; }

/* ===== Q&A detail ===== */
.post-head h1 { font-size: 1.7rem; margin: .3rem 0 .6rem; }
.vote-col { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.vote-btn { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 36px; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.vote-btn:hover { border-color: var(--teal); color: var(--teal); }
.vote-btn.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.vote-score { font-weight: 800; font-size: 1.15rem; color: var(--navy); font-family: "Cairo"; }
.entry { display: grid; grid-template-columns: 56px 1fr; gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.entry-body { line-height: 1.9; }
.entry-body h2 { font-size: 1.25rem; }
.entry-body pre { background: var(--navy); color: #e2e8f0; padding: 1rem; border-radius: 10px; overflow: auto; direction: ltr; text-align: left; }
.entry-body code { background: #eef2f7; padding: .1rem .35rem; border-radius: 5px; direction: ltr; unicode-bidi: embed; }
.entry-body pre code { background: none; padding: 0; }
/* highlight.js: keep our dark <pre> background, just colour the tokens. */
.hljs { background: transparent !important; padding: 0 !important; color: #e2e8f0; }
pre code.hljs { display: block; overflow-x: auto; }
.entry-body blockquote { border-inline-start: 4px solid var(--teal); margin: 1rem 0; padding: .3rem 1rem; color: var(--navy-600); background: var(--teal-50); border-radius: 8px; }
.entry-body img { border-radius: 8px; }
.accepted { border: 1px solid #bbf7d0; box-shadow: 0 0 0 3px #f0fdf4 inset; }
.accepted-badge { display: inline-flex; align-items: center; gap: .35rem; color: #15803d; font-weight: 800; font-size: .85rem; background: #dcfce7; padding: .3rem .8rem; border-radius: 999px; margin-bottom: .9rem; }
.author-card { display: flex; align-items: center; gap: .6rem; background: var(--teal-50); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; }
.author-card img, .author-card .avatar-fallback { width: 40px; height: 40px; }
.author-card-sm { padding: .45rem .7rem; }
.author-card-sm img, .author-card-sm .avatar-fallback { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

/* ===== Q&A page: clean vote / answer / comments separation ===== */
.qa-card { padding: 1.5rem 1.7rem; }
.qa-head { padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.qa-row { display: grid; grid-template-columns: 46px 1fr; gap: 1.2rem; align-items: start; }
.qa-main { min-width: 0; }
.qa-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.3rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.accept-btn { color: #15803d !important; font-weight: 800; }
.answers-title { margin: 1.8rem 0 1rem; }
/* Clear separation: the answers form their own labeled zone */
.qa-answers { margin-top: 2rem; }
.qa-answers-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  background: linear-gradient(135deg, var(--navy), var(--teal-700)); color: #fff;
  border-radius: 14px; padding: .85rem 1.3rem; margin-bottom: 1.2rem; }
.qa-answers-head h2 { color: #fff; margin: 0; font-size: 1.2rem; }
.qa-sort { color: #d7e3e1 !important; font-size: .85rem; }
.answer-card { position: relative; }
/* the vote column sits in its own subtle rail */
.vote-col { gap: .35rem; padding-top: .1rem; }
/* comments become a clearly separated zone (not glued to the answer) */
.qa-comments { margin-top: 1.2rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.1rem 1rem; }
.qa-comments-head { font-size: .8rem; font-weight: 800; color: var(--muted); letter-spacing: .2px; margin-bottom: .3rem; }
.qa-comments .comment-list { margin-top: .4rem; }
.qa-comments .comment-body { background: #fff; border: 1px solid var(--line); }
.qa-comments .comment-item.reply .comment-body { background: var(--teal-50); border-color: transparent; }
.qa-comments .reply-input { background: #fff; }
.qa-comments .comment-compose { margin-top: .8rem; }
@media (max-width: 560px) {
  .qa-card { padding: 1.1rem 1rem; }
  .qa-row { grid-template-columns: 40px 1fr; gap: .8rem; }
}
/* Color-coded type so question / answer / accepted are obvious at a glance */
.qa-question { border-inline-start: 4px solid var(--teal); }
.answer-card { border-inline-start: 4px solid #cbd5e1; }
.answer-card.accepted { border-inline-start-color: #22c55e; }
.qa-type { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-size: .8rem; padding: .34rem .9rem; border-radius: 999px; margin-bottom: 1rem; }
.qa-type-q { background: var(--teal-50); color: var(--teal-700); }
.qa-type-a { background: #eef1f6; color: #51607a; }
.qa-type-accepted { background: #dcfce7; color: #15803d; }
.qa-comments-head { color: var(--teal-700); }

/* ===== Help center ===== */
.help-hero { background: linear-gradient(135deg, var(--navy), var(--teal-700)); color: #fff; border-radius: 18px; padding: 2.4rem 2rem; text-align: center; margin: 1.4rem 0 .6rem; }
.help-hero h1 { color: #fff; margin: 0 0 .5rem; }
.help-hero p { color: #dbe2f4; max-width: 56ch; margin: 0 auto; }
.help-quick { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.help-quick a { background: rgba(255,255,255,.14); color: #fff; padding: .5rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.help-quick a:hover { background: rgba(255,255,255,.26); text-decoration: none; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.help-card { display: flex; gap: .9rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; color: var(--ink); box-shadow: var(--shadow); transition: transform .14s, border-color .14s; }
.help-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--teal); }
.help-ico { font-size: 1.7rem; line-height: 1; flex: 0 0 auto; }
.help-card-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.help-card-body b { color: var(--navy); }
.help-card-body .muted { font-size: .85rem; line-height: 1.6; }
.help-article { padding: 2.2rem 2.4rem; max-width: 860px; margin-inline: auto; }
.help-art-top { border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; margin-bottom: 1.4rem; }
.help-art-top h1 { font-size: 2rem; line-height: 1.35; margin: .5rem 0 .6rem; }
.help-summary { font-size: 1.12rem; color: var(--navy-600); line-height: 1.9; background: var(--teal-50); border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 1.4rem; }
/* Long-form article typography (strong readability + clean hierarchy) */
.help-body { line-height: 2.05; font-size: 1.07rem; color: #2a2d44; }
.help-body > *:first-child { margin-top: 0; }
.help-body h2 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--teal-50); scroll-margin-top: 80px; }
.help-body h3 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; color: var(--navy); }
.help-body p { margin: .9rem 0; }
.help-body a { color: var(--teal-700); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.help-body strong { color: var(--navy); font-weight: 800; }
.help-body ul, .help-body ol { padding-inline-start: 1.6rem; margin: .9rem 0; }
.help-body li { margin: .5rem 0; }
.help-body li::marker { color: var(--teal); }
.help-body blockquote { margin: 1.2rem 0; padding: .8rem 1.2rem; background: var(--bg); border-inline-start: 4px solid var(--teal); border-radius: 0 10px 10px 0; color: var(--navy-600); }
.help-body code { background: #eef1f7; color: #b3306b; padding: .12rem .4rem; border-radius: 6px; font-size: .92em; direction: ltr; unicode-bidi: embed; }
.help-body pre { background: var(--navy); color: #e7eaf3; padding: 1.1rem 1.3rem; border-radius: 12px; overflow-x: auto; direction: ltr; text-align: left; margin: 1.2rem 0; line-height: 1.7; }
.help-body pre code { background: none; color: inherit; padding: 0; }
.help-body img { border-radius: 12px; border: 1px solid var(--line); margin: 1rem 0; }
.help-body table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .98rem; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.help-body th { background: var(--teal-50); color: var(--navy); font-weight: 800; padding: .7rem 1rem; text-align: start; }
.help-body td { padding: .65rem 1rem; border-top: 1px solid var(--line); }
.help-body tr:nth-child(even) td { background: var(--bg); }
.help-foot { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 560px) { .help-article { padding: 1.2rem 1.1rem; } }
/* TL;DR (answer-engine friendly) */
.help-tldr { background: var(--teal-50); border: 1px solid #d9def8; border-inline-start: 4px solid var(--teal); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1.6rem; }
.help-tldr-label { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .3px; color: var(--teal-700); background: #fff; padding: .15rem .6rem; border-radius: 999px; margin-bottom: .5rem; }
.help-tldr p { margin: 0; font-size: 1.12rem; line-height: 1.9; color: var(--navy); font-weight: 600; }
/* FAQ accordion */
.help-faq { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.help-faq h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; background: var(--card); overflow: hidden; }
.faq-item summary { cursor: pointer; font-weight: 700; padding: .9rem 1.1rem; color: var(--navy); list-style: none; position: relative; padding-inline-end: 2.4rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "＋"; position: absolute; inset-inline-end: 1.1rem; top: .85rem; color: var(--teal-700); font-weight: 800; }
.faq-item[open] summary::after { content: "－"; }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-a { padding: .9rem 1.1rem; line-height: 1.9; color: var(--ink); }
/* My reports */
.mr-stats { display: flex; gap: .8rem; margin: 1rem 0 1.2rem; flex-wrap: wrap; }
.mr-stat { flex: 1; min-width: 120px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; text-align: center; box-shadow: var(--shadow); }
.mr-stat b { display: block; font-size: 1.4rem; color: var(--navy); }
.mr-stat span { font-size: .82rem; color: var(--muted); }
.mr-row { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.mr-row:last-child { border-bottom: 0; }
.mr-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.mr-badge { font-weight: 700; font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; }
.mr-open { background: #fef9c3; color: #854d0e; }
.mr-done { background: #dcfce7; color: #15803d; }
.mr-dismiss { background: #eef1f6; color: #51607a; }
.mr-what { margin: .5rem 0 .3rem; color: var(--ink); line-height: 1.7; }
.mr-link { font-size: .85rem; font-weight: 700; }
.mr-note { font-size: .8rem; }
.help-sec-desc { margin: -.4rem 0 .8rem; }
/* Support tickets */
.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.tk-row:last-child { border-bottom: 0; }
.tk-row:hover { text-decoration: none; }
.tk-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.tk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; vertical-align: middle; }
.tk-head { border-bottom: 1px solid var(--line); padding-bottom: .9rem; margin-bottom: 1.1rem; }
.tk-thread { display: flex; flex-direction: column; gap: .8rem; }
.tk-msg { border-radius: 14px; padding: .8rem 1rem; max-width: 85%; }
.tk-mine { background: var(--teal-50); align-self: flex-start; }
.tk-staff { background: #f0fdf4; border: 1px solid #bbf7d0; align-self: flex-end; }
.tk-msg-head { display: flex; align-items: center; gap: .6rem; justify-content: space-between; margin-bottom: .25rem; font-size: .82rem; }
.tk-msg p { margin: 0; line-height: 1.8; white-space: pre-line; word-break: break-word; }
.tk-reply { margin-top: 1.2rem; display: flex; gap: .6rem; align-items: flex-end; }
.tk-reply textarea { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; font: inherit; resize: vertical; }

/* ===== Gated profile (guests) ===== */
.profile-locked { text-align: center; padding: 3rem 1.6rem; margin-top: 1rem;
  background: linear-gradient(160deg, var(--teal-50), #fff); border: 1px solid var(--line); }
.profile-locked .pl-icon { font-size: 3rem; line-height: 1; }
.profile-locked h2 { font-size: 1.6rem; margin: .6rem 0 .5rem; color: var(--navy); }
.profile-locked p { color: var(--navy-600); max-width: 48ch; margin: 0 auto; line-height: 1.9; font-size: 1.05rem; }
.profile-locked .pl-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin: 1.4rem 0 .4rem; }
.profile-locked .pl-foot { font-size: .85rem; margin: .4rem 0 0; }
.byline { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; }

/* ===== Comments ===== */
.comments { margin-top: .8rem; border-top: 1px dashed var(--line); padding-top: .6rem; }
.comment { font-size: .88rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); color: var(--navy-600); }
.comment .c-author { font-weight: 600; color: var(--teal-700); }

/* ===== Forms ===== */
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; outline: none;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.form-field .helptext { display: block; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.form-field .errorlist { color: #b91c1c; font-size: .82rem; list-style: none; padding: 0; margin: .3rem 0 0; }

/* Sectioned settings form */
.edit-profile-form { display: flex; flex-direction: column; gap: 1.1rem; }
.edit-section { margin: 0; }
.edit-section-title { margin: 0 0 .9rem; font-size: 1.08rem; font-weight: 800; color: var(--ink); padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.edit-section-hint { margin: -.4rem 0 1rem; font-size: .85rem; color: var(--muted); }
.edit-section .form-field:last-child { margin-bottom: 0; }
.edit-section.company-only { border: 1px solid var(--teal-50); box-shadow: 0 0 0 2px var(--teal-50) inset; }
.privacy-toggles { display: flex; flex-direction: column; gap: .2rem; }
.toggle-row { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .7rem; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--navy); transition: background .15s; }
.toggle-row:hover { background: var(--bg); }
.toggle-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); flex: 0 0 auto; margin: .15rem 0 0; }
.toggle-row span { line-height: 1.4; display: flex; flex-direction: column; gap: .2rem; }
.toggle-row span .st-hint { display: block; margin: 0; font-weight: 400; line-height: 1.5; }
.form-errors { background: #fff6f6; border: 1px solid #fecaca; color: #b91c1c; border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; }
/* Email-verification nudge banner + verify page */
.verify-banner { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  background: #fff8e6; border: 1px solid #f6d979; color: #7a5b00; border-radius: 12px;
  padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.verify-banner .vb-ico { font-size: 1.2rem; }
.verify-banner .vb-text { flex: 1 1 auto; }
.verify-banner .vb-btn { background: var(--teal); color: #fff; border-radius: 999px;
  padding: .35rem .9rem; font-weight: 700; white-space: nowrap; }
.verify-banner .vb-btn:hover { background: var(--teal-700); text-decoration: none; }
.verify-card { max-width: 460px; margin: 0 auto; }
.verify-lead { color: var(--navy-600); line-height: 1.7; margin: 0 0 1.1rem; }
.verify-form { display: flex; flex-direction: column; gap: .6rem; }
.verify-label { font-weight: 700; color: var(--navy); }
.verify-code { font-size: 1.8rem; letter-spacing: .5rem; text-align: center; font-weight: 800;
  padding: .6rem; border: 2px solid var(--line); border-radius: 12px; color: var(--navy); }
.verify-code:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); outline: none; }
.verify-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.verify-foot .link-btn { color: var(--teal-700); font-weight: 700; }
.verify-devhint { margin-top: 1rem; font-size: .82rem; color: var(--muted); background: var(--bg);
  border-radius: 8px; padding: .5rem .7rem; }

/* ===== AI résumé reviewer (animated) ===== */
.cv-ai { border: 1px solid var(--teal-50); position: relative; overflow: hidden; }
.cv-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cv-ai-title { display: flex; align-items: center; gap: .7rem; }
.cv-ai-spark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, #1f63cf, #14cabb); color: #fff; font-size: 1.2rem;
  box-shadow: 0 6px 18px rgba(20,202,187,.35); animation: cvspark 3.5s ease-in-out infinite; }
@keyframes cvspark { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.12); } }
.cv-ai-title h2 { margin: 0; font-size: 1.05rem; }
.cv-ai-title p { margin: .1rem 0 0; font-size: .82rem; }
.cv-ai-btn { white-space: nowrap; }
.cv-ai-scan { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.1rem; padding: 1.1rem 1.2rem;
  border-radius: 14px; background: linear-gradient(135deg, #0b1f3a, #0e2a4d); }
.cv-scan-doc { position: relative; width: 90px; height: 118px; flex: 0 0 auto; border-radius: 8px;
  background: #fff; padding: 14px 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.cv-scan-l { display: block; height: 7px; border-radius: 4px; margin-bottom: 9px;
  background: linear-gradient(90deg, #dbe4ee, #eef2f7); animation: cvshimmer 1.4s ease-in-out infinite; }
.cv-scan-l:nth-child(1){width:70%} .cv-scan-l:nth-child(2){width:100%} .cv-scan-l:nth-child(3){width:85%}
.cv-scan-l:nth-child(4){width:95%} .cv-scan-l:nth-child(5){width:60%} .cv-scan-l:nth-child(6){width:80%}
@keyframes cvshimmer { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.cv-scan-beam { position: absolute; left: 0; right: 0; height: 26px; top: -26px;
  background: linear-gradient(180deg, rgba(20,202,187,0), rgba(20,202,187,.55) 50%, rgba(20,202,187,0));
  box-shadow: 0 0 18px 4px rgba(20,202,187,.6); animation: cvbeam 1.5s ease-in-out infinite; }
@keyframes cvbeam { 0% { top: -26px; } 100% { top: 118px; } }
.cv-ai-pct { font-size: 2.4rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #6ee7df, #14cabb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv-ai-msg { color: #b9c7da; margin-top: .35rem; font-size: .9rem; }
.cv-ai-result { margin-top: 1.1rem; animation: cvfade .45s ease; }
@keyframes cvfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cv-ai-top { display: flex; align-items: center; gap: 1rem; }
.cv-score { position: relative; width: 84px; height: 84px; flex: 0 0 auto; display: grid; place-items: center; }
.cv-score svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cv-score circle { fill: none; stroke-width: 3.2; }
.cv-score .cvs-bg { stroke: var(--line); }
.cv-score .cvs-fg { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 100;
  stroke-dashoffset: 100; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1); }
.cv-score-great .cvs-fg { stroke: #16a34a; } .cv-score-good .cvs-fg { stroke: #14cabb; }
.cv-score-ok .cvs-fg { stroke: #f59e0b; } .cv-score-low .cvs-fg { stroke: #ef4444; }
.cv-score b { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1; }
.cv-score span { font-size: .62rem; color: var(--muted); }
.cv-ai-verdict h3 { margin: 0; font-size: 1.05rem; }
.cv-ai-src { font-size: .75rem; color: var(--teal-700); font-weight: 700; }
.cv-ai-block { margin-top: 1.1rem; }
.cvb-h { font-weight: 800; margin-bottom: .5rem; font-size: .92rem; }
.cvb-good { color: #16a34a; } .cvb-fix { color: #b45309; }
.cv-ai-strengths { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.cv-ai-strengths li { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; border-radius: 999px;
  padding: .3rem .7rem; font-size: .82rem; font-weight: 600; }
.cv-ai-issues { display: flex; flex-direction: column; gap: .6rem; }
.cv-issue { border-radius: 12px; padding: .7rem .9rem; border-inline-start: 4px solid var(--line); background: var(--bg); }
.cv-issue.sev-high { border-color: #ef4444; background: #fef2f2; }
.cv-issue.sev-medium { border-color: #f59e0b; background: #fffbeb; }
.cv-issue.sev-low { border-color: #94a3b8; background: #f8fafc; }
.cvi-prob { font-weight: 700; color: var(--navy); }
.cvi-sug { font-size: .86rem; color: var(--navy-600); margin-top: .25rem; }
.cv-ai-rewrite { margin-top: 1.1rem; padding: .9rem 1rem; border-radius: 12px;
  background: var(--teal-50); border: 1px solid #c7d2fe; }
.cvr-label { font-weight: 800; color: var(--teal-700); margin-bottom: .4rem; font-size: .9rem; }
.cv-ai-rewrite p { margin: 0 0 .6rem; color: var(--navy); line-height: 1.7; }
.cv-ai-empty { text-align: center; color: var(--muted); padding: 1rem; }
.qa-ai-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.qa-tag-chip { background: var(--teal-50); color: var(--teal-700); border: 1px solid #c7d2fe;
  border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; font-weight: 700; cursor: pointer; transition: all .15s; }
.qa-tag-chip:hover { background: var(--teal); color: #fff; }
.qa-tag-chip.added { background: #ecfdf5; color: #166534; border-color: #bbf7d0; cursor: default; }
.qa-ai-sum { margin: 0; padding: .7rem .9rem; background: var(--bg); border-radius: 10px;
  color: var(--navy-600); line-height: 1.7; font-size: .9rem; }

/* ===== Library ===== */
.lib-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lib-hero .page-title { margin: 0; }
/* Locked member books (guests) */
.lib-lock { position: absolute; top: 12px; inset-inline-end: 20px; z-index: 4; font-size: 1.1rem;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(15,23,42,.55); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.lib-locked .lib-card-cover img { filter: grayscale(.4) brightness(.8); }
/* Share book to community (inside the dark hero band) */
.lib-share-community { margin: .7rem 0 0; }
.lib-share-community summary { cursor: pointer; color: rgba(255,255,255,.92); font-weight: 700; font-size: .9rem; list-style: none; }
.lib-share-community summary::-webkit-details-marker { display: none; }
.lib-share-community summary::marker { content: ""; }
.lib-share-community summary:hover { color: #fff; }
.lib-share-community form { margin-top: .6rem; display: flex; flex-direction: column; gap: .55rem; max-width: 460px; }
.lib-share-community textarea { width: 100%; border-radius: 10px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; padding: .6rem .8rem; font: inherit; resize: vertical; }
.lib-share-community textarea::placeholder { color: rgba(255,255,255,.6); }
.lib-share-community .btn-sm { align-self: flex-start; }
/* Book card inside a feed post (shared book) */
.lib-post-card .cv-post-ic { background: var(--teal-50); }

/* Support page: form + suggested help articles (fills the side space) */
.support-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.6rem; align-items: start; }
.support-form { max-width: none; }
.support-help { position: sticky; top: 84px; }
.support-help-h { font-size: 1.05rem; margin: 0 0 .9rem; }
.support-help-list { display: flex; flex-direction: column; gap: .7rem; }
.support-help-card { display: flex; gap: .7rem; align-items: flex-start; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: .8rem .9rem; transition: border-color .15s, transform .15s, box-shadow .15s; }
.support-help-card:hover { border-color: var(--teal); transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(30,33,71,.22); text-decoration: none; }
.support-help-ic { font-size: 1.35rem; flex: 0 0 auto; line-height: 1.2; }
.support-help-meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.support-help-meta b { color: var(--navy); line-height: 1.45; font-size: .92rem; }
.support-help-meta .muted { font-size: .8rem; line-height: 1.5; }
.support-help-all { margin-top: 1rem; }
@media (max-width: 860px) { .support-layout { grid-template-columns: 1fr; } .support-help { position: static; } }
.lib-search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.lib-search input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: .6rem 1.1rem; background: var(--bg); }
.lib-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); outline: none; }
.lib-sort { display: flex; gap: .4rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.lib-sort a { padding: .35rem .9rem; border-radius: 999px; font-weight: 700; font-size: .85rem; color: var(--navy-600); background: var(--bg); }
.lib-sort a.active { background: var(--teal); color: #fff; }
/* Library grid — big, book-like cards */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 1.6rem; }
.lib-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; transition: transform .22s ease, box-shadow .22s ease; box-shadow: 0 6px 18px rgba(30,33,71,.07); }
.lib-card:hover { transform: translateY(-7px); box-shadow: 0 26px 50px -18px rgba(30,33,71,.32); text-decoration: none; }

/* The cover is shaped like a real book (tall), coloured by file type */
.lib-card-cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(150deg, #475569, #1e293b); }
.lib-card-cover img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.lib-card:hover .lib-card-cover img { transform: scale(1.07); }
/* book spine (binding edge) + soft top light */
.lib-card-cover::before { content: ""; position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 14px; z-index: 2;
  background: linear-gradient(90deg, rgba(255,255,255,.22), rgba(0,0,0,.10) 35%, rgba(0,0,0,.30)); }
.lib-card-cover::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(130% 65% at 22% -5%, rgba(255,255,255,.28), transparent 58%); }
.lib-ext-badge { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3;
  font-weight: 800; font-size: .78rem; letter-spacing: .3px; color: #fff; padding: .28rem .7rem; border-radius: 8px;
  background: rgba(15,23,42,.42); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,.18); }
.lib-cover-overlay { position: relative; z-index: 3; padding: 30px 18px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.55) 48%, rgba(0,0,0,.85)); }
.lib-card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: #fff; font-family: "Cairo", sans-serif; font-weight: 800; font-size: 1.1rem; line-height: 1.38;
  text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.lib-card-author { display: block; margin-top: 7px; color: rgba(255,255,255,.86); font-size: .8rem; }
.lib-card-foot { display: flex; align-items: center; gap: .8rem; padding: .75rem 1rem; font-size: .84rem; font-weight: 700; color: var(--muted); }
.lib-stars { color: #f59e0b; }
.lib-dl { color: var(--navy-600); }
.lib-kind { margin-inline-start: auto; background: var(--bg); padding: .18rem .6rem; border-radius: 7px; color: var(--navy-600); font-size: .76rem; }

/* per-type cover gradients (richer, brand-coloured spines) */
.lib-ext-pdf  .lib-card-cover { background: linear-gradient(150deg, #f05252, #991b1b); }
.lib-ext-doc  .lib-card-cover, .lib-ext-docx .lib-card-cover { background: linear-gradient(150deg, #3b82f6, #1e40af); }
.lib-ext-xls  .lib-card-cover, .lib-ext-xlsx .lib-card-cover { background: linear-gradient(150deg, #10b981, #065f46); }
.lib-ext-ppt  .lib-card-cover, .lib-ext-pptx .lib-card-cover { background: linear-gradient(150deg, #fb923c, #9a3412); }
.lib-ext-csv  .lib-card-cover { background: linear-gradient(150deg, #22d3ee, #0e7490); }
.lib-ext-txt  .lib-card-cover { background: linear-gradient(150deg, #94a3b8, #334155); }
/* per-type detail cover gradients (the lib-ext-* class is ON the cover element) */
.lib-ext-pdf.lib-detail-cover  { background: linear-gradient(150deg, #f05252, #991b1b); }
.lib-ext-doc.lib-detail-cover, .lib-ext-docx.lib-detail-cover { background: linear-gradient(150deg, #3b82f6, #1e40af); }
.lib-ext-xls.lib-detail-cover, .lib-ext-xlsx.lib-detail-cover { background: linear-gradient(150deg, #10b981, #065f46); }
.lib-ext-ppt.lib-detail-cover, .lib-ext-pptx.lib-detail-cover { background: linear-gradient(150deg, #fb923c, #9a3412); }
.lib-ext-csv.lib-detail-cover  { background: linear-gradient(150deg, #22d3ee, #0e7490); }
.lib-ext-txt.lib-detail-cover  { background: linear-gradient(150deg, #94a3b8, #334155); }
.lib-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.6rem 0; }
/* detail */
.lib-review-banner { background: #fffbeb; border: 1px solid #fde68a; color: #92600a; border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1.1rem; font-weight: 600; }
.lib-detail-head { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.lib-detail-cover { width: 190px; aspect-ratio: 3 / 4; flex: 0 0 auto; border-radius: 14px; position: relative;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, #475569, #1e293b); box-shadow: 0 20px 44px -20px rgba(30,33,71,.45); }
.lib-detail-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lib-detail-cover::before { content: ""; position: absolute; inset-inline-end: 0; top: 0; bottom: 0; width: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.22), rgba(0,0,0,.10) 35%, rgba(0,0,0,.3)); }
.lib-detail-cover .lib-ext-badge { position: static; font-size: 1.05rem; padding: .4rem 1.1rem;
  background: rgba(15,23,42,.4); border: 1px solid rgba(255,255,255,.2); }
.lib-detail-actions { display: flex; gap: .55rem; flex-wrap: wrap; }

/* Detail hero band — bookstore-style header */
.lib-hero-band { position: relative; overflow: hidden; display: flex; gap: clamp(1.2rem, 3vw, 2.2rem); flex-wrap: wrap;
  align-items: center; padding: clamp(1.4rem, 4vw, 2.6rem); border-radius: 20px; margin-bottom: 1.2rem;
  background: linear-gradient(155deg, #1e293b, #0f172a); }
.lib-hero-band::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(65% 90% at 88% 0%, rgba(255,255,255,.08), transparent 60%); }
.lib-ext-pdf.lib-hero-band::before  { background: radial-gradient(70% 95% at 88% -5%, rgba(240,82,82,.34), transparent 60%); }
.lib-ext-doc.lib-hero-band::before, .lib-ext-docx.lib-hero-band::before { background: radial-gradient(70% 95% at 88% -5%, rgba(59,130,246,.34), transparent 60%); }
.lib-ext-xls.lib-hero-band::before, .lib-ext-xlsx.lib-hero-band::before { background: radial-gradient(70% 95% at 88% -5%, rgba(16,185,129,.34), transparent 60%); }
.lib-ext-ppt.lib-hero-band::before, .lib-ext-pptx.lib-hero-band::before { background: radial-gradient(70% 95% at 88% -5%, rgba(251,146,60,.34), transparent 60%); }
.lib-ext-csv.lib-hero-band::before  { background: radial-gradient(70% 95% at 88% -5%, rgba(34,211,238,.32), transparent 60%); }
.lib-hero-band .lib-detail-cover { z-index: 1; flex: 0 0 auto; }
.lib-hero-info { z-index: 1; flex: 1 1 320px; color: #fff; }
.lib-hero-info h1 { margin: .55rem 0 .35rem; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.32; color: #fff; }
.lib-hero-kind { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  color: #fff; font-weight: 700; font-size: .82rem; padding: .3rem .85rem; border-radius: 999px; }
.lib-hero-author { color: rgba(255,255,255,.85); margin: 0 0 1rem; font-size: .92rem; }
.lib-hero-stats { display: flex; gap: .55rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.lib-stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 11px;
  padding: .42rem .85rem; font-weight: 700; font-size: .88rem; color: #fff; }
.lib-stat-star { color: #fde047; }
.lib-hero-stats .muted, .lib-stat small { color: rgba(255,255,255,.7); font-weight: 600; }
.lib-hero-uploader { margin: 1.1rem 0 0; font-size: .84rem; color: rgba(255,255,255,.72); }
.lib-hero-uploader a { color: #fff; font-weight: 700; }
.btn-glass { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.btn-glass:hover { background: rgba(255,255,255,.26); color: #fff; }
.btn-glass.danger { color: #fecaca; border-color: rgba(248,113,113,.5); }

/* Detail body card */
.lib-body-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.2rem, 3vw, 2rem); }
.lib-body-card .lib-rate { margin: 0 0 1.2rem; }
.lib-rate { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.lib-rate-label { font-weight: 700; color: var(--navy); }
.lib-stars-input { display: inline-flex; gap: .15rem; }
.lib-star { background: none; border: none; font-size: 1.5rem; color: var(--line); cursor: pointer; padding: 0 .1rem; transition: color .12s; }
.lib-star.on { color: #f59e0b; }
.lib-rate-msg { font-size: .85rem; font-weight: 600; }
.lib-desc { margin-top: 1.2rem; }
.lib-comments { margin-top: 1.4rem; }
/* Ask page: form + assistant sidebar widget */
.ask-head { max-width: 1000px; margin: 0 auto .2rem; }
.ask-layout { display: grid; grid-template-columns: 1fr 330px; gap: 1.4rem; align-items: start;
  max-width: 1000px; margin: 0 auto; }
.ask-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }
.qa-ai-widget .cv-ai-title h2 { font-size: 1rem; }
.qa-ai-widget .cv-ai-btn { margin-top: .9rem; }
.qa-ai-widget .cv-ai-scan { gap: .8rem; padding: .9rem; }
.qa-ai-widget .cv-scan-doc { width: 64px; height: 84px; }
.qa-ai-widget .cv-ai-pct { font-size: 1.8rem; }
.qa-tips h3 { margin: 0 0 .7rem; font-size: 1rem; }
.qa-tips ul { margin: 0; padding-inline-start: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.qa-tips li { color: var(--navy-600); font-size: .88rem; line-height: 1.6; }
@media (max-width: 900px) {
  .ask-layout { grid-template-columns: 1fr; }
  .ask-side { position: static; flex-direction: column-reverse; }
}
/* Signup method chooser */
.signup-card .social-login { margin-top: 0; }
.signup-email-head { font-weight: 700; margin-bottom: .8rem; padding-top: .2rem; }

/* AI first-responder answer */
.ai-answer { border: 1px solid #c7d2fe; background:
  linear-gradient(180deg, rgba(91,91,214,.05), transparent 120px); position: relative; }
.ai-answer-tag { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.ai-answer-badge { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; font-size: .82rem;
  color: #fff; background: linear-gradient(135deg, #1f63cf, #14cabb); padding: .3rem .8rem; border-radius: 999px; }
.ai-answer-tag .muted { font-size: .8rem; }
.ai-answer-foot { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.ai-answer-cta { border: 1px dashed #c7d2fe; background: var(--teal-50); }
.ai-cta-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ai-cta-text b { display: block; color: var(--navy); font-size: 1.02rem; }
.ai-cta-text .muted { font-size: .85rem; }
.ai-answer-err { margin-top: .8rem; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 10px; padding: .6rem .9rem; font-size: .88rem; font-weight: 600; }
/* Social login buttons */
.social-login { margin-top: 1.2rem; }
.social-divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .82rem; margin-bottom: .9rem; }
.social-divider::before, .social-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-btns { display: flex; flex-direction: column; gap: .6rem; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  padding: .7rem 1rem; border-radius: 12px; font-weight: 700; border: 1px solid var(--line);
  background: #fff; color: var(--navy); transition: background .15s, border-color .15s; }
.social-btn:hover { background: var(--bg); text-decoration: none; }
.social-btn svg { flex: 0 0 auto; }
.social-github { background: #1f2328; color: #fff; border-color: #1f2328; }
.social-github:hover { background: #32383f; }
.social-linkedin { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.social-linkedin:hover { background: #0954a0; }
.social-linkedin.loading .social-ic { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.social-btn.loading { opacity: .75; pointer-events: none; }
.social-btn.loading .social-ic { width: 18px; height: 18px; border: 2px solid var(--line);
  border-top-color: var(--teal); border-radius: 50%; animation: socspin .7s linear infinite; }
.social-btn.loading .social-ic svg { display: none; }
.social-github.loading .social-ic { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes socspin { to { transform: rotate(360deg); } }
/* Welcome username picker */
.uname-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.uname-row:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.uname-prefix { display: flex; align-items: center; padding: 0 .7rem; background: var(--bg); color: var(--muted);
  font-size: .85rem; direction: ltr; border-inline-end: 1px solid var(--line); }
.uname-row input { border: none !important; box-shadow: none !important; flex: 1; }
.uname-hint { display: block; font-size: .82rem; font-weight: 700; margin-top: .35rem; min-height: 1.1em; }
.uname-hint.good { color: #16a34a; } .uname-hint.bad { color: #dc2626; } .uname-hint.checking { color: var(--muted); }
/* New-member welcome + terms acceptance */
.welcome-card { max-width: 540px; margin: 1rem auto 0; }
.welcome-hero { text-align: center; margin-bottom: 1.2rem; }
.welcome-ava { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto .8rem; overflow: hidden;
  display: grid; place-items: center; background: linear-gradient(135deg, #1f63cf, #14cabb);
  color: #fff; font-weight: 800; font-size: 1.6rem; }
.welcome-ava img { width: 100%; height: 100%; object-fit: cover; }
.welcome-hero h1 { margin: 0; font-size: 1.5rem; }
.welcome-rules { background: var(--bg); border-radius: 12px; padding: 1rem 1.2rem; margin: 1.2rem 0; }
.welcome-rules h2 { font-size: 1rem; margin: 0 0 .6rem; }
.welcome-rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.welcome-rules li { display: flex; gap: .5rem; align-items: flex-start; color: var(--navy-600); line-height: 1.6; }
.welcome-rules li span { flex: 0 0 auto; }
.welcome-agree { display: flex; gap: .55rem; align-items: flex-start; margin: 1rem 0 1.2rem; font-weight: 600; color: var(--navy); }
.welcome-agree input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--teal); flex: 0 0 auto; }
.welcome-agree a { color: var(--teal-700); font-weight: 700; }
/* Onboarding community-explanation boxes */
.onb-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem; margin: 0 auto 2rem; max-width: 760px; }
.onb-feat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem;
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.onb-feat:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(30,33,71,.08); border-color: var(--teal-50); }
.onb-feat-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  background: var(--teal-50); font-size: 1.3rem; margin-bottom: .6rem; }
.onb-feat b { display: block; color: var(--navy); font-size: 1rem; margin-bottom: .25rem; }
.onb-feat p { margin: 0; color: var(--navy-600); font-size: .86rem; line-height: 1.6; }
.onb-pick-h { text-align: center; font-size: 1.2rem; margin: .5rem 0 .2rem; }
/* Guided tour (spotlight coach-marks) */
.tour-root { position: fixed; inset: 0; z-index: 4000; pointer-events: none; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(11,18,32,.66);
  outline: 3px solid var(--teal); outline-offset: 3px; pointer-events: none;
  transition: top .3s cubic-bezier(.4,0,.2,1), left .3s cubic-bezier(.4,0,.2,1),
    width .3s cubic-bezier(.4,0,.2,1), height .3s cubic-bezier(.4,0,.2,1); }
.tour-pop { position: fixed; width: min(330px, 92vw); background: #fff; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.32); padding: 1.1rem 1.2rem; pointer-events: auto; z-index: 4001;
  animation: tourpop .25s ease; }
@keyframes tourpop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-pop-center { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; }
.tour-pop-step { font-size: .74rem; color: var(--teal-700); font-weight: 800; margin-bottom: .3rem; }
.tour-pop-title { margin: 0 0 .4rem; font-size: 1.1rem; }
.tour-pop-text { margin: 0 0 1rem; color: var(--navy-600); line-height: 1.75; font-size: .92rem; }
.tour-pop-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tour-nav { display: flex; gap: .4rem; }
.tour-skip { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .84rem; font-weight: 600; }
.tour-skip:hover { color: var(--navy); }
.tour-prev { background: none; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .75rem;
  cursor: pointer; color: var(--navy); font-weight: 700; font-size: .85rem; }
.tour-prev:hover { background: var(--bg); }
.remember-me { display: flex; align-items: center; gap: .55rem; margin: .2rem 0 1rem; font-weight: 600; color: var(--navy); cursor: pointer; user-select: none; }
.remember-me input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); flex: 0 0 auto; margin: 0; cursor: pointer; }
.remember-me span { line-height: 1.4; font-size: .92rem; }

/* ===== Profile ===== */
.profile-head { display: flex; gap: 1.2rem; align-items: center; }
.profile-head img, .profile-head .avatar-fallback { width: 92px; height: 92px; border-radius: 18px; font-size: 2rem; }
.profile-stats { display: flex; gap: 1.5rem; margin: 1rem 0; }
.profile-stats .stat b { color: var(--navy); }

/* ===== Pagination ===== */
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 1.8rem 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); background: #fff; }
.pagination .current { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ===== Footer ===== */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: 3rem; padding: 2.5rem 0 1.4rem; }
.site-footer .brand-text, .site-footer h3 { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-grid nav { display: flex; flex-direction: column; gap: .4rem; }
.footer-grid a { color: #cbd5e1; }
.footer-grid h3 { font-size: .95rem; margin: 0 0 .4rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.6rem; padding-top: 1rem; font-size: .85rem; }
@media (max-width: 720px){ .footer-grid { grid-template-columns: 1fr; } .main-nav { display: none; } }

.page-title { margin: 1.4rem 0 .4rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 1.6rem 0 .6rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem; }

/* ===== Notification bell + icon button ===== */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 1.2rem; background: var(--bg); }
.icon-btn:hover { background: var(--teal-50); text-decoration: none; }
.bell-badge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #e11d48; color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.rail-badge { background: #e11d48; color: #fff; font-size: .72rem; font-weight: 800; padding: 0 .4rem; border-radius: 999px; }

/* ===== Notifications page ===== */
.notif-list { padding: 0; }
.notif { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--bg); text-decoration: none; }
.notif.unread { background: var(--teal-50); }
.notif-ava img, .notif-ava .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.notif-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif-snippet { font-size: .85rem; }
.notif-time { font-size: .78rem; }
.saved-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.saved-row:last-child { border-bottom: 0; }
/* Saved (bookmarks) page — render each item as its FULL card */
.saved-tabs { flex-wrap: wrap; }
.saved-tabs .t-count { display: inline-block; min-width: 1.1rem; padding: 0 .35rem; margin-inline-start: .15rem; font-size: .72rem; line-height: 1.3rem; text-align: center; background: var(--line); color: var(--muted); border-radius: 999px; }
.saved-tabs a.active .t-count { background: var(--teal); color: #fff; }
.saved-list { display: flex; flex-direction: column; gap: 1rem; }
.saved-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
/* neutralize each card's own outer chrome so we don't double-border */
.saved-card .feed-post,
.saved-card .job-card { border: 0; border-radius: 0; box-shadow: none; margin: 0; background: transparent; }
.saved-card .q-item { padding: 1.1rem 1.25rem; border-bottom: 0; }
.saved-card .job-card { padding: 1.05rem 1.25rem; }
/* compact reel card */
.sv-reel { display: flex; gap: 1rem; padding: 1rem 1.1rem; align-items: stretch; }
.sv-reel-thumb { position: relative; flex: 0 0 84px; width: 84px; height: 112px; border-radius: 12px; overflow: hidden; background: #1e2147; display: flex; align-items: center; justify-content: center; }
.sv-reel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sv-reel-play { position: absolute; color: #fff; font-size: 1.5rem; opacity: .9; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.sv-reel-badge { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: .68rem; padding: .12rem .4rem; border-radius: 999px; }
.sv-reel-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .4rem; }
.sv-reel-author { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; }
.sv-reel-author img, .sv-reel-author .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sv-reel-cap { color: var(--ink); line-height: 1.5; }
.sv-reel-meta { font-size: .82rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }

/* Notification dropdown (from the bell) */
.notif-wrap { position: relative; }
.notif-dropdown { position: absolute; top: 50px; inset-inline-end: 0; width: 360px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 44px rgba(16,32,46,.2); z-index: 200; overflow: hidden; }
.notif-dd-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.notif-dd-head .link-btn { color: var(--teal-700); font-size: .8rem; }
.notif-dd-body { max-height: 62vh; overflow-y: auto; }
.notif-dd-body .notif { padding: .7rem 1rem; }
.notif-dd-foot { display: block; text-align: center; padding: .75rem; border-top: 1px solid var(--line); font-weight: 700; color: var(--teal-700); }
.notif-dd-foot:hover { background: var(--bg); text-decoration: none; }

/* ===== @mention / #hashtag links (rendered bodies) ===== */
.entry-body a[href^="/accounts/users/"], .entry-body a[href^="/tags/"],
.fp-body a[href^="/accounts/users/"], .fp-body a[href^="/tags/"],
.comment-body a[href^="/accounts/users/"], .comment-body a[href^="/tags/"] {
  color: var(--teal-700); font-weight: 600; background: var(--teal-50); padding: 0 .25rem; border-radius: 5px;
}

/* ===== Actions menu extras ===== */
.fp-menu-sep { height: 1px; background: var(--line); margin: .3rem 0; }
.fp-menu-list a { display: block; padding: .55rem .6rem; border-radius: 8px; color: var(--navy-600); }
.fp-menu-list a:hover { background: var(--teal-50); text-decoration: none; }
.fp-menu-list form { margin: 0; }
.fp-menu-list .danger { color: #b91c1c; }
.fp-menu-list .danger:hover { background: #fef2f2; }
.report-reasons { display: flex; flex-direction: column; gap: .2rem; padding: .3rem; }
.report-reasons button { text-align: start; background: none; border: 0; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; font: inherit; }
.report-reasons button:hover { background: #fef2f2; color: #b91c1c; }
.report-done { color: var(--green); padding: .4rem; font-size: .85rem; }
.qa-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .85rem; }
.link-btn.danger { color: #b91c1c; }

/* ===== Mobile bottom navigation ===== */
.bottom-nav { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
  .container, .container-wide { width: 94%; }
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .ask-btn, .logout-form { display: none; }
  .header-inner { gap: .5rem; padding: .55rem 0; }
  .brand-text { font-size: 1.02rem; }
  .search { order: 3; min-width: 100%; }
  .auth { gap: .4rem; margin-inline-start: auto; }

  /* mobile bottom nav */
  body { padding-bottom: 68px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 90;
    background: var(--card); border-top: 1px solid var(--line);
    justify-content: space-around; align-items: center; height: 60px;
    box-shadow: 0 -2px 12px rgba(16,32,46,.06);
  }
  .bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.3rem; color: var(--navy-600); flex: 1; }
  .bottom-nav a span { font-size: .62rem; }
  .bottom-nav a:hover { text-decoration: none; color: var(--teal-700); }
  .bn-add { background: var(--teal); color: #fff !important; width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto !important; font-size: 1.6rem !important; box-shadow: var(--shadow); }
  .bn-badge { position: absolute; top: -2px; inset-inline-end: 18px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: #e11d48; color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; font-style: normal; }

  .hero { padding: 1.6rem; border-radius: 16px; }
  .hero h1 { font-size: 1.5rem; }
  .stat-row { gap: 1.2rem; }
  .btn { min-height: 42px; }
  .btn-lg { width: 100%; text-align: center; }
  .form-field input, .form-field textarea, .form-field select { font-size: 16px; }  /* avoid iOS zoom */
  .reel-stage { gap: 1rem; }
  .profile-top { margin-top: -52px; padding: 0 1.1rem; }
  .profile-avatar { width: 120px; height: 120px; border-radius: 26px; }
  .profile-avatar img, .profile-avatar .avatar-fallback { border-radius: 21px; font-size: 2.8rem; }
  .profile-body { padding: 1rem 1.1rem 0; }
  .profile-name { font-size: 1.4rem; }
  .post-head h1, .reel-player { max-width: 100%; }
}

@media (max-width: 540px) {
  .composer-tools .tool-lbl { display: none; }
  .composer-tools .tool-btn { min-width: 40px; padding: 0 .5rem; }
  .profile-stats { gap: 1.1rem 1.4rem; padding: 1rem 0 .3rem; }
  .profile-stats .stat b { font-size: 1.2rem; }
  .reels-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .q-item { grid-template-columns: 1fr; }
  .q-stats { flex-direction: row; gap: .8rem; min-width: 0; }
  .entry, .comment-item { grid-template-columns: 40px 1fr; }
  .fp-menu-list { width: 200px; }
  .hero h1 { font-size: 1.3rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn { width: 100%; text-align: center; }
}

/* ===== Facebook-style 3-column feed ===== */
/* Constrained + centered like Facebook: a cozy fixed feed column (never stretches
   on wide monitors), with comfortable side rails and breathing room. */
/* Wider layout: side rails grow (1fr) to fill the screen, feed stays a comfy 760. */
.fb-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 760px) minmax(300px, 1fr); gap: 2rem; align-items: start; justify-content: center; max-width: 1820px; margin: 1.1rem auto 3rem; }
.fb-layout.no-left { grid-template-columns: minmax(0, 780px) minmax(320px, 460px); max-width: 1280px; }
.feed-left, .feed-right { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 1rem; }
.feed-center { min-width: 0; }
@media (max-width: 1200px) { .fb-layout, .fb-layout.no-left { grid-template-columns: minmax(0, 1fr) 340px; max-width: 1100px; } .feed-left { display: none; } }
@media (max-width: 820px) { .fb-layout, .fb-layout.no-left { grid-template-columns: minmax(0, 1fr); max-width: 700px; } .feed-right { display: none; } }

/* Left rail */
.feed-left { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); }
.rail-me { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; font-weight: 700; color: var(--navy); }
.rail-me:hover { background: var(--bg); text-decoration: none; }
.rail-me img, .rail-me .avatar-fallback { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.rail-nav { display: flex; flex-direction: column; }
.rail-nav a { padding: .55rem .6rem; border-radius: 10px; color: var(--navy-600); font-weight: 600; font-size: .95rem; }
.rail-nav a:hover { background: var(--teal-50); color: var(--teal-700); text-decoration: none; }
.rail-nav a.active { background: var(--teal-50); color: var(--teal-700); font-weight: 800; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; padding: 1.1rem 1.3rem; flex-wrap: wrap; }
.rail-sep { height: 1px; background: var(--line); margin: .6rem 0; }
.rail-title { font-size: .78rem; color: var(--muted); font-weight: 700; padding: 0 .6rem .3rem; }

/* Stories / reels strip */
.stories { display: flex; gap: .6rem; overflow-x: auto; padding: .2rem .1rem .7rem; scrollbar-width: thin; margin-bottom: .9rem; }
.story { flex: 0 0 auto; width: 106px; text-align: center; }
.story span { display: block; font-size: .76rem; color: var(--navy-600); margin-top: .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-thumb { position: relative; width: 106px; height: 178px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, var(--navy), var(--teal-700)); border: 2px solid var(--teal); }
.story-thumb video { width: 100%; height: 100%; object-fit: cover; }
.story-create .story-thumb { display: grid; place-items: center; background: linear-gradient(160deg, var(--teal-50), #fff); border-color: var(--line); }
.story-create .story-thumb img, .story-create .avatar-fallback { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; }
.story-plus { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; border: 2px solid #fff; font-weight: 800; font-size: 1.1rem; }
.discover-card a { display: block; padding: .3rem 0; color: var(--navy-600); }

/* Story rings + author bubble */
.story.unseen .story-thumb { border: 3px solid; border-color: #e1306c; box-shadow: 0 0 0 2px #fff inset; }
.story:not(.unseen):not(.story-create) .story-thumb { border-color: var(--line); }
.story-author-ava { position: absolute; bottom: 6px; inset-inline-end: 6px; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; }
.story-author-ava img, .story-author-ava .avatar-fallback { width: 100%; height: 100%; object-fit: cover; font-size: .85rem; }

/* ===== Media filters (apply to direct-child media only) ===== */
.filter-none > img, .filter-none > video { filter: none; }
.filter-grayscale > img, .filter-grayscale > video { filter: grayscale(1); }
.filter-sepia > img, .filter-sepia > video { filter: sepia(.65); }
.filter-warm > img, .filter-warm > video { filter: saturate(1.4) brightness(1.05) hue-rotate(-8deg); }
.filter-cool > img, .filter-cool > video { filter: saturate(1.2) brightness(1.02) hue-rotate(12deg); }
.filter-vivid > img, .filter-vivid > video { filter: saturate(1.8) contrast(1.1); }
.filter-vintage > img, .filter-vintage > video { filter: sepia(.4) contrast(.92) brightness(1.08) saturate(1.3); }
.filter-bright > img, .filter-bright > video { filter: brightness(1.3) saturate(1.1); }
.filter-dark > img, .filter-dark > video { filter: brightness(.78) contrast(1.15); }

/* ===== Story editor ===== */
.story-editor-grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.6rem; margin-top: 1rem; }
@media (max-width: 720px) { .story-editor-grid { grid-template-columns: 1fr; justify-items: center; } }
.story-preview { position: relative; width: 320px; height: 560px; max-width: 100%; border-radius: 18px; overflow: hidden; background: #0b1220; display: grid; place-items: center; box-shadow: var(--shadow); }
.sp-media { width: 100%; height: 100%; object-fit: cover; }
.sp-placeholder { color: #fff; opacity: .65; font-size: .95rem; }
.sp-text { position: absolute; inset-inline: 0; padding: 1rem 1.2rem; text-align: center; font-size: 1.5rem; font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.7); word-break: break-word; }
.sp-text.pos-top { top: 1.2rem; } .sp-text.pos-center { top: 50%; transform: translateY(-50%); } .sp-text.pos-bottom { bottom: 1.6rem; }
.story-controls { max-width: 520px; }
.story-upload-row { display: flex; gap: .6rem; }
.upload-pill { cursor: pointer; } .upload-pill input { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-chip { padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .8rem; text-transform: capitalize; }
.filter-chip.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.text-tools { display: flex; align-items: center; gap: 1.2rem; margin-top: .6rem; flex-wrap: wrap; }
.text-tools label { display: inline-flex; align-items: center; gap: .4rem; }
.pos-chips { display: inline-flex; gap: .3rem; }
.pos-chip { padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: .8rem; }
.pos-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.privacy-options label { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .45rem; cursor: pointer; font-weight: 600; }
.privacy-options label:hover { border-color: var(--teal); background: var(--teal-50); }

/* ===== Story viewer (full-screen) ===== */
.story-viewer { position: fixed; inset: 0; background: #000; z-index: 1000; display: flex; align-items: center; justify-content: center; }
/* Instagram-style segmented progress (one segment per story in the author's group) */
.sv-progress { position: absolute; top: 12px; inset-inline: 5%; height: 3px; z-index: 4; display: flex; gap: 4px; }
.sv-seg { flex: 1; height: 100%; background: rgba(255,255,255,.35); border-radius: 3px; overflow: hidden; }
.sv-seg-fill { height: 100%; width: 0; background: #fff; border-radius: 3px; }
.sv-seg.done .sv-seg-fill { width: 100%; }
.sv-head { position: absolute; top: 22px; inset-inline: 5%; display: flex; align-items: center; gap: .6rem; color: #fff; z-index: 5; }
.sv-author { display: flex; align-items: center; gap: .5rem; color: #fff; flex: 1 1 auto; min-width: 0; }
.sv-author:hover { text-decoration: none; }
.sv-author img, .sv-author .avatar-fallback { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.sv-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-privacy { margin-inline-start: auto; font-size: .8rem; opacity: .9; flex: 0 0 auto; white-space: nowrap; }
.sv-close { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 1.25rem; flex: 0 0 auto; z-index: 6; }
.sv-close:hover { background: rgba(255,255,255,.32); text-decoration: none; }
.sv-stage { position: relative; width: 94%; max-width: 440px; height: 82vh; display: grid; place-items: center; }
.sv-stage > img, .sv-stage > video { max-width: 100%; max-height: 100%; border-radius: 14px; object-fit: contain; }
.sv-text { position: absolute; inset-inline: 0; padding: 1rem 1.2rem; text-align: center; font-size: 1.7rem; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.75); word-break: break-word; }
.sv-text.pos-top { top: 1.4rem; } .sv-text.pos-center { top: 50%; transform: translateY(-50%); } .sv-text.pos-bottom { bottom: 2rem; }
/* Tap zones (RTL): RIGHT side = previous, LEFT side = next. */
.sv-tap { position: absolute; top: 64px; bottom: 64px; z-index: 3; }
.sv-prev { inset-inline-start: 0; width: 32%; }
.sv-next { inset-inline-end: 0; width: 68%; }
/* Visible nav arrows */
.sv-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center; font-size: 1.15rem; line-height: 1; z-index: 5; }
.sv-arrow:hover { background: rgba(255,255,255,.36); text-decoration: none; }
.sv-arrow-prev { inset-inline-start: 10px; }   /* right in RTL = previous */
.sv-arrow-next { inset-inline-end: 10px; }     /* left in RTL = next */
@media (max-width: 540px) { .sv-arrow { width: 40px; height: 40px; font-size: 1.3rem; } }
.sv-owner { position: absolute; bottom: 22px; display: flex; align-items: center; gap: 1rem; color: #fff; z-index: 5; background: rgba(0,0,0,.4); padding: .4rem .9rem; border-radius: 999px; }

/* ===== Twitter-like feed ===== */
.btn-sm { padding: .3rem .8rem; font-size: .85rem; }
.composer { padding: 1rem 1.2rem; }
.composer-row { display: flex; gap: .7rem; align-items: flex-start; }
.composer-row .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; }
.composer textarea { flex: 1; border: 0; resize: vertical; font: inherit; outline: none; padding: .5rem 0; background: transparent; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.join-cta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.join-cta p { margin: 0; flex: 1; min-width: 180px; }

.feed-post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .75rem; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.05rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.fp-avatar img, .fp-avatar .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.fp-suggested { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800; color: var(--teal-700); background: var(--teal-50); padding: .2rem .65rem; border-radius: 999px; margin-bottom: .5rem; }
.fp-head { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .9rem; }
.fp-name { font-weight: 700; color: var(--navy); }
.fp-handle, .fp-dot, .fp-time { color: var(--muted); }
.fp-time:hover { color: var(--teal-700); }
.fp-title { display: block; font-weight: 700; color: var(--navy); margin: .3rem 0; font-size: 1.05rem; }

/* Post "···" feedback menu */
.fp-menu { margin-inline-start: auto; position: relative; }
.fp-menu summary { list-style: none; cursor: pointer; color: var(--muted); padding: 0 .4rem; border-radius: 6px; font-size: 1.1rem; }
.fp-menu summary::-webkit-details-marker { display: none; }
.fp-menu summary:hover { background: var(--bg); color: var(--ink); }
.fp-menu-list { position: absolute; inset-inline-end: 0; top: 1.8rem; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .35rem; width: 230px; }
.fp-menu-list button { display: block; width: 100%; text-align: start; background: none; border: 0; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; font: inherit; color: var(--navy-600); }
.fp-menu-list button:hover { background: var(--teal-50); }
.feed-post.removing { opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .3s; }

/* Comment fold/unfold on feed cards */
.js-toggle-comments .caret { display: inline-block; font-size: .7rem; transition: transform .2s; }
.js-toggle-comments.open .caret { transform: rotate(180deg); }
.card-comments { margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .5rem; }

/* Composer media preview */
.composer-preview { position: relative; margin: .6rem 0; display: inline-block; max-width: 100%; }
.composer-preview .preview-media { display: block; max-width: 100%; max-height: 280px; border-radius: 12px; background: #000; }
.composer-preview .preview-name { display: block; font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.composer-preview .preview-remove { position: absolute; top: 8px; inset-inline-end: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .85rem; display: grid; place-items: center; }
.composer-preview .preview-remove:hover { background: rgba(0,0,0,.8); }
/* In compact reply/comment rows, the preview takes its own line */
.reply-box, .comment-compose { flex-wrap: wrap; }
.reply-box .composer-preview, .comment-compose .composer-preview { width: 100%; }
.reply-box .composer-preview .preview-media, .comment-compose .composer-preview .preview-media { max-height: 180px; }
.fp-body { line-height: 1.85; margin: .2rem 0 .5rem; }
.fp-body p:first-child { margin-top: 0; }
.fp-body pre { background: var(--navy); color: #e2e8f0; padding: .8rem; border-radius: 8px; overflow: auto; direction: ltr; text-align: left; }
.fp-body code { background: #eef2f7; padding: .1rem .3rem; border-radius: 4px; direction: ltr; unicode-bidi: embed; }
.fp-actions { display: flex; gap: 1.4rem; margin-top: .4rem; }
.fp-action { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .9rem; }
.fp-action:hover { color: var(--teal-700); text-decoration: none; }
.fp-action.liked { color: #e11d48; }

/* ---- Reactions (Facebook-style) ---- */
.fp-react { position: relative; display: inline-flex; align-items: center; gap: .5rem; }
.js-react-btn .rx-face { font-size: 1.05rem; line-height: 1; }
.js-react-btn.reacted { font-weight: 700; }
.js-react-btn.r-like  { color: #2563eb; }
.js-react-btn.r-love  { color: #e11d48; }
.js-react-btn.r-haha,
.js-react-btn.r-wow,
.js-react-btn.r-sad   { color: #d97706; }
.js-react-btn.r-angry { color: #ea580c; }
/* faces + count summary — its own row ABOVE the actions (Facebook-style), so the
   button emoji is never shown twice next to the aggregate faces. */
.fp-react-summary { display: flex; align-items: center; gap: .3rem; padding: .5rem 0 .15rem; font-size: .85rem; color: var(--muted); }
.fp-react-summary[hidden] { display: none; }
.fp-react-summary .rx-faces { display: inline-flex; }
.fp-react-summary .rx-faces i { font-style: normal; font-size: 1rem; margin-inline-start: -3px; filter: drop-shadow(0 0 1px #fff); }
.fp-react-summary .rx-faces i:first-child { margin-inline-start: 0; }
/* picker bar */
.react-pop {
  position: absolute; bottom: calc(100% + 6px); inset-inline-start: -4px;
  display: flex; gap: .15rem; padding: .3rem .4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16,32,46,.18);
  opacity: 0; transform: translateY(6px) scale(.92); transform-origin: bottom center;
  pointer-events: none; transition: opacity .14s ease, transform .14s ease; z-index: 60;
}
.fp-react.show-pop .react-pop { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.react-pop button {
  border: 0; background: none; cursor: pointer; font-size: 1.4rem; line-height: 1;
  padding: .15rem .2rem; border-radius: 50%; transition: transform .12s ease;
}
.react-pop button:hover { transform: scale(1.35) translateY(-3px); }

.new-posts-pill { display: block; margin: 0 auto .8rem; background: var(--teal); color: #fff; border: 0; border-radius: 999px; padding: .5rem 1.2rem; font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); position: sticky; top: 70px; z-index: 20; }
.new-posts-pill:hover { background: var(--teal-700); }

/* who-to-follow */
.who-card h3 { margin-top: 0; }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .7rem; }
.who-id { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.who-id img, .who-id .avatar-fallback { width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; }
.who-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who-meta b { font-size: .9rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-meta .muted { font-size: .8rem; }
.who-reason { font-size: .76rem; color: var(--teal-700); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priv-lock { font-size: .78rem; opacity: .65; }

/* Sidebar mini-list widgets (last questions / last posts) */
.side-widget .section-title { display: flex; align-items: center; justify-content: space-between; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-item { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.mini-item:first-child { padding-top: 0; }
.mini-item:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-title { display: block; font-weight: 700; font-size: .9rem; color: var(--navy); line-height: 1.5; }
.mini-title:hover { color: var(--teal-700); text-decoration: none; }
.mini-meta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .25rem; font-size: .78rem; color: var(--muted); }

a.stat { text-decoration: none; }
a.stat:hover b { color: var(--teal-700); }

/* ===== Premium profile (cover + avatar) ===== */
.profile-cover-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 10px 40px rgba(16,32,46,.10); margin: 1rem 0 1.4rem; }
/* Cover lives inside the centre column so its width == the content width. */
.profile3 .profile-cover-card { margin-top: 0; }
.profile3 .profile-tabs { margin-top: .2rem; }

/* 3-column profile: NEW widgets (right) · content (centre) · OLD widgets (left).
   Named areas force all three into one row (explicit grid-column alone let the
   asides drop to row 2). In RTL the first area = inline-start = the right side. */
.profile3 { display: grid; grid-template-columns: 290px minmax(0, 1fr) 290px; grid-template-areas: "right center left"; gap: 1.4rem; margin: 1rem 0 3rem; align-items: start; }
.profile3 .side-right { grid-area: right; }   /* right in RTL */
.profile3 .main-col   { grid-area: center; min-width: 0; }
.profile3 .side-left  { grid-area: left; }     /* left in RTL */
.profile3 .side-right, .profile3 .side-left { position: sticky; top: 78px; align-self: start; }
.profile3 .side-right .card, .profile3 .side-left .card { margin-bottom: 1.2rem; }
.profile3 .side-right h3, .profile3 .side-left h3 { margin-top: 0; font-size: 1rem; }
.tag-cloud { gap: .4rem; }

/* Narrower screens: one column — content, then new widgets, then old widgets. */
@media (max-width: 1100px) {
  .profile3 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "right" "left"; }
  .profile3 .side-right, .profile3 .side-left { position: static; }
}
/* Phone: shrink the FB-style cover/avatar header so it fits a narrow screen
   and the 6 content tabs scroll horizontally instead of forcing page width. */
@media (max-width: 560px) {
  .profile-top { padding: 0 .9rem; margin-top: -42px; gap: .6rem; }
  .profile-avatar { width: 96px; height: 96px; border-radius: 24px; border-width: 4px; }
  .profile-avatar img, .profile-avatar .avatar-fallback { border-radius: 20px; font-size: 2.3rem; }
  .avatar-edit { width: 34px; height: 34px; font-size: .82rem; }
  .profile-cta { gap: .4rem; }
  .profile-cta .btn { min-height: 36px; font-size: .84rem; padding-inline: .7rem; }
  .profile-body { padding: .85rem .9rem 0; }
  .profile-name { font-size: 1.4rem; }
  .profile-meta { gap: .5rem .9rem; font-size: .84rem; }
  .profile-stats { gap: .8rem 1.1rem; padding-top: 1rem; justify-content: space-between; }
  .profile-stats .stat b { font-size: 1.2rem; }
  .profile-stats .stat .muted { font-size: .74rem; }
  .founder-emblem { font-size: .76rem; padding: .35rem .75rem; top: 10px; }
  .cover-edit { font-size: .74rem; padding: .35rem .7rem; bottom: 10px; }
  /* Content tabs → horizontal scroll, no page-width blowout. */
  .profile-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .profile-tabs a { white-space: nowrap; flex: 0 0 auto; }
}
/* Facebook-style cover ratio (~2.7:1) — scales with width, capped on big screens. */
/* Full-width cover, Facebook-like responsive height. NB: do NOT combine
   aspect-ratio with max-height — that shrinks the WIDTH when the height caps,
   leaving an empty side strip. A plain clamp() height always fills the width. */
.profile-cover { position: relative; width: 100%; height: clamp(200px, 26vw, 340px); background-color: #0b1b2b; background-image: linear-gradient(120deg, #0b1b2b, var(--teal-700) 65%, var(--teal)); background-size: cover; background-position: center; background-repeat: no-repeat; }
.profile-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 120%, rgba(255,255,255,.18), transparent 60%); pointer-events: none; }
.cover-edit { position: absolute; bottom: 14px; inset-inline-end: 18px; background: rgba(0,0,0,.55); color: #fff; padding: .42rem .9rem; border: 0; cursor: pointer; font: inherit; font-weight: 700; border-radius: 999px; font-size: .82rem; backdrop-filter: blur(4px); z-index: 3; display: inline-flex; align-items: center; gap: .3rem; }
.cover-edit:hover { background: rgba(0,0,0,.78); text-decoration: none; }
.cover-edit.busy { opacity: .6; pointer-events: none; }
.profile-cover.repositioning { cursor: grab; touch-action: none; }
.profile-cover.repositioning:active { cursor: grabbing; }
.profile-cover.repositioning::after { background: rgba(0,0,0,.1); }
.cover-repos-bar { position: absolute; bottom: 14px; inset-inline: 0; z-index: 5; display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; padding: 0 1rem; }
.cover-repos-bar[hidden] { display: none; }
.crb-hint { background: rgba(0,0,0,.6); color: #fff; padding: .4rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 600; backdrop-filter: blur(4px); }
.cover-repos-bar .btn { box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.cover-repos-bar .btn-ghost { background: #fff; color: var(--navy); border-color: transparent; font-weight: 700; }
.cover-repos-bar .btn-ghost:hover { background: #f0f0f6; }
.cover-repos-bar .btn-primary { background: var(--teal); color: #fff; }

/* Row over the cover: avatar on one side, action buttons on the other. */
.profile-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 0 1.8rem; margin-top: -62px; flex-wrap: wrap; position: relative; }
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
/* Facebook-size avatar (~168px) */
.profile-avatar { display: block; width: 168px; height: 168px; border-radius: 34px; border: 6px solid var(--card); overflow: hidden; background: var(--card); box-shadow: 0 8px 24px rgba(16,32,46,.18); }
.profile-avatar img, .profile-avatar .avatar-fallback { width: 100%; height: 100%; border-radius: 28px; object-fit: cover; font-size: 4rem; }
.profile-avatar .avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; }
.avatar-edit { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; border: 3px solid var(--card); font-size: .9rem; cursor: pointer; padding: 0; font: inherit; box-shadow: 0 2px 6px rgba(16,32,46,.25); z-index: 3; }
.avatar-edit:hover { background: var(--teal-700); text-decoration: none; }
.avatar-edit.busy { opacity: .6; pointer-events: none; }

.profile-cta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-bottom: .4rem; }
/* Keep every profile action button the same height; icon+text vertically centred. */
.profile-cta .btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding-block: 0; line-height: 1; white-space: nowrap; }
.profile-cta .share-btn { padding-inline: .85rem; }

/* Identity block on the white card — name, badges, bio, meta, stats. */
.profile-body { padding: 1.1rem 1.8rem 0; }
.profile-name { margin: 0; font-size: 1.9rem; font-family: "Cairo"; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; line-height: 1.2; }
.profile-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 .15rem; }
.founder-ribbon { display: inline-flex; align-items: center; gap: .3rem; padding: .28rem .85rem; border-radius: 999px; font-weight: 800; font-size: .8rem; line-height: 1.4; }
.founder-ribbon.badge-founder { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; text-shadow: 0 1px 2px rgba(120,53,15,.55); box-shadow: 0 3px 10px rgba(180,83,9,.4); border: 1px solid #fde68a; }
.founder-ribbon.badge-team { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 3px 10px rgba(5,150,105,.4); border: 1px solid #6ee7b7; }
.founder-ribbon.badge-mod { background: #ede9fe; color: #6d28d9; }
.profile-handle { color: var(--muted); font-size: .95rem; margin-top: .25rem; }

.profile-bio { margin: 1rem 0 0; line-height: 1.9; color: var(--navy-600); white-space: pre-line; max-width: 68ch; }
.profile-bio a { color: var(--teal-700); font-weight: 600; word-break: break-word; }
.profile-bio a:hover { text-decoration: underline; }

.profile-meta { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .9rem; margin-top: 1rem; }
.profile-meta a { color: var(--teal-700); display: inline-flex; align-items: center; gap: .25rem; }
.profile-meta a:hover { text-decoration: underline; }

.profile-stats { display: flex; gap: 1.8rem; flex-wrap: wrap; padding: 1.2rem 0 .3rem; margin-top: 1.1rem; border-top: 1px solid var(--line); }
.profile-stats .stat { text-align: center; }
.profile-stats .stat b { font-size: 1.45rem; font-family: "Cairo"; color: var(--navy); display: block; line-height: 1.1; }
.profile-stats .stat .muted { font-size: .82rem; }
.profile-stats .stat.reputation b { color: var(--accent); }
.profile-stats a.stat:hover b { color: var(--teal-700); }

/* Founder gold theme — name stays dark/readable on the white card. */
/* Use background-IMAGE (not the `background` shorthand) so a founder who uploads a
   real cover keeps background-size:cover/position from .profile-cover — the inline
   url() then simply overrides this gradient. The shorthand was resetting size→auto. */
.is-founder .profile-cover:not([style*="background-image"]) { background-image: linear-gradient(120deg, #1c1206, #92400e 55%, #f59e0b); }
.is-founder .profile-avatar { border-color: #fde68a; box-shadow: 0 0 0 4px rgba(245,158,11,.35), 0 8px 24px rgba(146,64,14,.3); }

/* Info card */
.info-list { list-style: none; padding: 0; margin: 0 0 .6rem; }
.info-list li { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .9rem; color: var(--navy-600); }
.info-list li span { flex: 0 0 auto; }

.avatar-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.avatar-grid a img, .avatar-grid a .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-grid a:hover { transform: translateY(-2px); transition: .15s; }
/* 'Who viewed your profile': each viewer once, with a repeat-visit count badge. */
.wv-viewer { position: relative; display: inline-block; }
.wv-count-badge { position: absolute; bottom: -3px; inset-inline-end: -3px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .64rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); }
.answer-row { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.answer-row:last-child { border-bottom: 0; }
.answer-row > a { font-weight: 600; color: var(--navy); }

/* ===== Special badges ===== */
.user-badge { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 800; padding: .08rem .5rem; border-radius: 999px; vertical-align: middle; }
.badge-founder { background: linear-gradient(135deg, #f59e0b, #b45309); color: #fff; box-shadow: 0 1px 4px rgba(180,83,9,.45); border: 1px solid #fcd34d; }
.badge-team { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 1px 4px rgba(5,150,105,.45); border: 1px solid #6ee7b7; }
.badge-mod { background: #ede9fe; color: #6d28d9; }

/* Notification dropdown header actions + the "enable push" opt-in */
.notif-dd-actions { display: inline-flex; gap: .7rem; align-items: center; }
.js-notif-enable { color: var(--teal-700); font-weight: 700; }
body.notif-granted .js-notif-enable { display: none; }

/* ===== Explore / trending + topic following ===== */
.explore-sec { margin: 1.6rem 0; }
.explore-h { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.explore-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 900px) { .explore-grid { grid-template-columns: minmax(0, 1fr); } }
.trend-tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.trend-tag { display: inline-flex; align-items: center; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .35rem .3rem .9rem; box-shadow: var(--shadow); }
.trend-tag > a { font-weight: 700; color: var(--navy); }
.trend-tag > a:hover { color: var(--teal-700); text-decoration: none; }
.trend-tag.is-following { border-color: var(--teal); background: var(--teal-50); }
.tagfollow-btn { border: 0; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 800; padding: .26rem .7rem; border-radius: 999px; background: var(--teal); color: #fff; }
.tagfollow-btn:hover { background: var(--teal-700); }
.trend-tag.is-following .tagfollow-btn { background: #fff; color: var(--teal-700); border: 1px solid var(--teal); }

/* Onboarding interest picker */
.onboarding { max-width: 720px; margin: 1.5rem auto 3rem; }
.onb-tags { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.4rem; }
.onb-chip { position: relative; cursor: pointer; }
.onb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.onb-chip span { display: inline-block; padding: .5rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 700; color: var(--navy-600); background: var(--bg); transition: .12s; user-select: none; }
.onb-chip:hover span { border-color: var(--teal); }
.onb-chip.checked span { background: var(--teal); color: #fff; border-color: var(--teal); }
.onb-chip.checked span::before { content: "✓ "; }
.onb-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* ===== Related questions / posts (internal linking for SEO) ===== */
.related-qs-h { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 0 0 .9rem; }
/* Distinct boxes in a responsive grid — each related item is clearly its own card. */
.related-qs-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.related-qs-list li { padding: .85rem .9rem; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.related-qs-list li:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 32, 46, .10); border-color: var(--teal-700); }
.related-qs-link { display: block; font-weight: 700; color: var(--navy); line-height: 1.5; }
.related-qs-link:hover { color: var(--teal-700); text-decoration: none; }
.related-qs-meta { display: block; font-size: .78rem; color: var(--muted); margin-top: .45rem; }

/* ===== Post media ===== */
.fp-media { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 12px; margin: .5rem 0; background: #000; }
.detail-media { display: block; width: 100%; max-height: 640px; object-fit: contain; border-radius: 12px; margin: 1rem 0; background: #0b1220; }

/* ===== Polls ===== */
.poll { display: flex; flex-direction: column; gap: .5rem; margin: .7rem 0; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; text-align: start; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: .65rem .9rem; cursor: pointer; font: inherit; font-weight: 600; color: var(--navy); overflow: hidden; }
.poll:not(.revealed) .poll-opt:hover { border-color: var(--teal); background: var(--teal-50); }
.poll.revealed .poll-opt { cursor: default; }
.poll-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: var(--teal-50); z-index: 0; transition: width .5s ease; }
.poll-opt.mine .poll-fill { background: linear-gradient(90deg, rgba(91,91,214,.22), rgba(91,91,214,.12)); }
.poll-opt.mine { border-color: var(--teal); }
.poll-opt-text, .poll-opt-pct { position: relative; z-index: 1; }
.poll-opt-pct { font-weight: 800; color: var(--teal-700); font-size: .9rem; }
.poll-opt.mine .poll-opt-text::after { content: " ✓"; color: var(--teal-700); font-weight: 800; }
.poll-total { font-size: .82rem; margin-top: .1rem; }

/* Poll builder (composer) */
.poll-builder { margin: .2rem 0 1.1rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.poll-toggle { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; cursor: pointer; }
.poll-inputs { display: flex; flex-direction: column; gap: .5rem; margin-top: .7rem; }
.poll-inputs[hidden] { display: none; }
.poll-opt-input { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; font: inherit; outline: none; }
.poll-opt-input:focus { border-color: var(--teal); }

/* ===== Markdown editor toolbar (insert + Write/Preview) ===== */
.md-toolbar { display: flex; flex-direction: column; gap: .45rem; margin: .1rem 0 .5rem; }
.md-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); }
.md-tab { border: 0; background: none; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); padding: .4rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.md-tab:hover { color: var(--navy); }
.md-tab.active { color: var(--teal-700); border-color: var(--teal); }
.md-tools { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.md-preview { min-height: 7rem; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; background: var(--card); }
.md-preview:empty { display: none; }
.md-btn { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); background: var(--card); color: var(--navy-600); border-radius: 8px; padding: .32rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; }
.md-btn:hover { background: var(--teal-50); border-color: var(--teal); color: var(--teal-700); }
.md-insert { position: relative; }
.md-insert > summary { list-style: none; }
.md-insert > summary::-webkit-details-marker { display: none; }
.md-insert-btn { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-50); }
.md-menu { position: absolute; top: calc(100% + 5px); inset-inline-start: 0; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(16,32,46,.16); padding: .3rem; min-width: 200px; display: flex; flex-direction: column; }
.md-menu button { text-align: start; border: 0; background: none; padding: .55rem .7rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; color: var(--navy); }
.md-menu button:hover { background: var(--teal-50); color: var(--teal-700); }

/* KaTeX: force LTR (math is left-to-right even inside RTL text) + isolate so the
   surrounding Arabic/RTL flow doesn't reverse the equation. */
.katex { direction: ltr; unicode-bidi: isolate; }
.katex-display { direction: ltr; text-align: center; overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }
.entry-body .katex, .fp-body .katex { font-size: 1.05em; }

/* ===== Composer tools ===== */
.composer-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.composer-tools { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.tool-btn { display: inline-flex; align-items: center; gap: .3rem; min-width: 38px; height: 38px; padding: 0 .6rem; border-radius: 10px; border: 0; background: var(--bg); cursor: pointer; font-size: 1.05rem; text-decoration: none; color: var(--navy-600); }
.tool-btn:hover { background: var(--teal-50); }
.tool-lbl { font-size: .82rem; font-weight: 600; }
@media (max-width: 520px) { .tool-lbl { display: none; } }

/* ===== Reply box / comments ===== */
.reply-box, .comment-compose { display: flex; gap: .4rem; align-items: center; margin-top: .6rem; }
.reply-input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font: inherit; outline: none; background: var(--bg); }
.reply-input:focus { border-color: var(--teal); background: #fff; }
.emoji-trigger, .sticker-label { background: var(--bg); border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; font-size: 1rem; flex: 0 0 auto; }
.emoji-trigger:hover, .sticker-label:hover { background: var(--teal-50); }
.reply-toggle { margin-top: .4rem; }
.reply-toggle summary { cursor: pointer; color: var(--teal-700); font-size: .85rem; font-weight: 600; }
.comment-list { margin-top: 1rem; }
.comment-item { display: grid; grid-template-columns: 40px 1fr; gap: .6rem; padding: .6rem 0; }
.comment-item.reply { margin-inline-start: 1.2rem; padding-bottom: 0; }
.comment-avatar { display: block; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.comment-avatar img, .comment-avatar .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.comment-body { background: var(--bg); border-radius: 12px; padding: .55rem .9rem; }
.comment-item.reply .comment-body { background: #eef2f7; }
.comment-line { font-size: .9rem; }
.comment-body p { margin: .2rem 0 0; }
.c-author { font-weight: 700; color: var(--teal-700); }
.comment-sticker { max-width: 160px; max-height: 160px; border-radius: 10px; margin-top: .4rem; }

/* ===== Pickers (emoji + stickers) ===== */
.picker-panel { position: absolute; z-index: 200; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 40px rgba(16,32,46,.18); overflow: hidden; }
.picker-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .85rem; border-bottom: 1px solid var(--line); font-weight: 700; font-size: .85rem; }
.picker-close { background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--muted); }
.picker-close:hover { color: var(--ink); }
.picker-grid { display: flex; flex-wrap: wrap; gap: .15rem; padding: .5rem; max-height: 220px; overflow-y: auto; }
.picker-item { background: none; border: 0; font-size: 1.3rem; cursor: pointer; width: 38px; height: 38px; border-radius: 8px; }
.picker-item:hover { background: var(--teal-50); }
.sticker-grid { gap: .35rem; }
.sticker-grid .sticker-item { background: none; border: 0; cursor: pointer; font-size: 2.3rem; width: 64px; height: 64px; border-radius: 12px; }
.sticker-grid .sticker-item:hover { background: var(--teal-50); transform: scale(1.12); transition: transform .1s; }
.sticker-msg { font-size: 3.4rem; line-height: 1.15; margin: .1rem 0; }

/* Animated GIF stickers (Tenor) */
.sticker-gif { display: block; max-width: 220px; max-height: 220px; border-radius: 14px; margin: .35rem 0; }
.gif-panel { width: 340px; max-width: 94vw; }
.gif-head { gap: .5rem; }
.gif-search { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .85rem; outline: none; }
.gif-search:focus { border-color: var(--teal); }
.gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; padding: .5rem; max-height: 340px; overflow-y: auto; min-height: 120px; }
.gif-item { border: 0; padding: 0; background: var(--bg); border-radius: 10px; overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.gif-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-item:hover { outline: 2px solid var(--teal); }
.gif-state { grid-column: 1 / -1; display: grid; place-items: center; min-height: 110px; color: var(--muted); font-size: .9rem; text-align: center; }
.gif-credit { text-align: center; font-size: .72rem; color: var(--muted); padding: .35rem; border-top: 1px solid var(--line); }

/* ===== Like animation + sound feedback ===== */
.heart-float { position: absolute; z-index: 300; pointer-events: none; color: #e11d48; font-size: 1.25rem; animation: heartUp .9s ease-out forwards; }
@keyframes heartUp { 0% { opacity: 1; transform: translate(-50%, 0) scale(.6); } 100% { opacity: 0; transform: translate(-50%, -48px) scale(1.6); } }
.fp-action.pop { animation: likePop .32s ease; }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.js-comment-form.sent .reply-input, .comment-compose.sent .reply-input { background: #f0fdf4; transition: background .3s; }
.sticker-label { overflow: hidden; }

/* ===== Reels ===== */
.reels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.reel-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.reel-thumb { display: block; position: relative; aspect-ratio: 9/16; background: #000; }
.reel-thumb video { width: 100%; height: 100%; object-fit: cover; }
.reel-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: rgba(255,255,255,.92); text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.reel-dur { position: absolute; bottom: 8px; inset-inline-start: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: .72rem; padding: .1rem .45rem; border-radius: 6px; }
.reel-info { padding: .7rem .8rem; }
.reel-author { display: flex; align-items: center; gap: .4rem; }
.reel-author img, .reel-author .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.reel-author b { font-size: .9rem; color: var(--navy); }
.reel-caption { margin: .4rem 0 .3rem; font-size: .9rem; }

/* ===== Reels feed (YouTube-style — frame adapts to each video's aspect) ===== */
.reels-main { width: 100%; max-width: none; margin: 0; padding: 0; }
body.reels-page { padding-bottom: 0; }
body.reels-page .site-footer, body.reels-page .bottom-nav { display: none; }
.reels-feed { --reel-w: min(94vw, 430px, calc((100dvh - 96px) * 9 / 16)); position: relative; height: calc(100dvh - 62px); overflow-y: scroll; scroll-snap-type: y mandatory; background: #0b0b12; scrollbar-width: none; }
.reels-feed::-webkit-scrollbar { display: none; }
.reel-slide { height: 100%; scroll-snap-align: start; display: grid; place-items: center; }
.reel-stage-2 { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; padding: .8rem; }
/* Always a phone-sized vertical 9:16 frame (capped at 430px wide on desktop).
   The video is contained inside it; a blurred copy fills any letterbox area so
   landscape clips look right (the YouTube Shorts behaviour). */
.reel-frame { position: relative; width: var(--reel-w); aspect-ratio: 9 / 16; border-radius: 20px; overflow: hidden; background: #000; box-shadow: 0 16px 50px rgba(0,0,0,.55); flex: none; }
.reel-bd { position: absolute; inset: 0; background: #0b0b12 center/cover no-repeat; filter: blur(34px) brightness(.5); transform: scale(1.25); z-index: 0; pointer-events: none; }
.reel-frame .reel-video { display: block; position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.reel-grad { position: absolute; inset-inline: 0; bottom: 0; height: 38%; background: linear-gradient(transparent, rgba(0,0,0,.7)); pointer-events: none; z-index: 2; }
.reel-playpause { position: absolute; inset: 0; background: transparent; border: 0; cursor: pointer; z-index: 2; }
.reel-playpause.paused::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: rgba(255,255,255,.92); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.reel-rail { position: absolute; bottom: 1rem; inset-inline-end: .6rem; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.reel-rail-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.7rem; line-height: 1; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.reel-rail-btn span { font-size: .78rem; font-weight: 700; }
.reel-rail-btn.liked { color: #ff4d6d; }
.reel-rail-btn.pop { animation: likePop .32s ease; }
.reel-overlay-b { position: absolute; bottom: 1rem; inset-inline-start: 1rem; inset-inline-end: 70px; color: #fff; z-index: 2; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.reel-author-b { display: inline-flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; }
.reel-author-b img, .reel-author-b .avatar-fallback { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.reel-author-b:hover { text-decoration: none; }
.reel-cap-b { margin: .5rem 0 0; font-size: .95rem; max-height: 4.5em; overflow: hidden; }
.reel-tags-b { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
.reel-tags-b a { color: #c7d2fe; font-weight: 600; font-size: .85rem; }
.reels-add-fab { position: fixed; bottom: 24px; inset-inline-start: 24px; width: 52px; height: 52px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 1.8rem; z-index: 40; box-shadow: var(--shadow); }
.reels-add-fab:hover { background: var(--teal-700); text-decoration: none; }
.reels-empty { height: 100%; display: grid; place-content: center; gap: 1rem; text-align: center; color: #fff; }

/* Reel comments — YouTube-style: open BESIDE the video (desktop) or BELOW a
   shrunken video (mobile). The reel keeps playing, so you watch + read at once. */
.reel-comments { display: none; flex-direction: column; background: #fff; overflow: hidden; }
.reel-slide.comments-open .reel-comments { display: flex; }
.reel-slide.comments-open .reel-stage-2 { gap: 14px; }
.rc-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.rc-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.reel-comments .comment-thread { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.reel-comments .comment-list { flex: 1; overflow-y: auto; padding: .6rem 1rem; }
.reel-comments .comment-compose { border-top: 1px solid var(--line); padding: .6rem 1rem; margin: 0; }
@media (min-width: 821px) {
  .reel-comments { width: 372px; height: calc(var(--reel-w) * 16 / 9); border-radius: 16px; box-shadow: 0 16px 50px rgba(0,0,0,.4); }
}
@media (max-width: 820px) {
  .reels-feed { --reel-w: min(100vw, calc((100dvh - 54px) * 9 / 16)); height: calc(100dvh - 54px); }
  .reel-stage-2 { padding: 0; }
  .reel-frame { border-radius: 0; box-shadow: none; width: 100vw; height: 100%; aspect-ratio: auto; }
  .reel-frame .reel-video { object-fit: cover; }  /* TikTok-style full-bleed fill */
  .reel-rail { bottom: 1rem; inset-inline-end: .5rem; gap: .95rem; }
  .reel-overlay-b { bottom: 1rem; inset-inline-end: 64px; }
  .reels-add-fab { bottom: 24px; inset-inline-start: 16px; width: 48px; height: 48px; }
  /* comments open: shrink the video to the top, comments fill the rest */
  .reel-slide.comments-open .reel-stage-2 { flex-direction: column; justify-content: flex-start; gap: 0; }
  .reel-slide.comments-open .reel-frame { width: 100vw; height: 40vh; aspect-ratio: auto; }
  .reel-comments { width: 100%; flex: 1; min-height: 0; border-radius: 16px 16px 0 0; }
}

/* Reel detail */
.reel-stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.5rem; margin: 1.2rem 0 3rem; align-items: start; }
.reel-player { background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 9/16; max-height: 80vh; }
.reel-player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.reel-actions { display: flex; gap: 1.2rem; margin-top: .6rem; }
@media (max-width: 820px){ .reel-stage { grid-template-columns: 1fr; } .reel-player { max-height: 70vh; margin-inline: auto; } }

/* ===== Chat / Messages (Messenger-style) ===== */
.msg-link { position: relative; }
.chat-main-wrap { width: min(96vw, 1600px); max-width: none; margin: 0 auto; }
body.chat-page .site-footer, body.chat-page .bottom-nav { display: none; }
.chat-shell { display: grid; grid-template-columns: 340px 1fr; height: calc(100dvh - 62px - 1.5rem); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 18px 50px rgba(30,33,71,.10); margin: .8rem auto 0; }
.chat-shell.has-aside { grid-template-columns: 340px minmax(0, 1fr) 340px; }

/* Sidebar */
.chat-sidebar { display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid var(--line); background: #fff; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, var(--teal-50), #fff); }
.chat-sidebar-head h1 { font-size: 1.35rem; margin: 0; color: var(--navy); }
.chat-req-link { position: relative; display: inline-flex; align-items: center; gap: .25rem; font-size: 1.4rem; line-height: 1; }
.pill { background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; font-style: normal; border-radius: 10px; padding: .05rem .4rem; margin-inline-start: 2px; }
.conv-list { flex: 1; overflow-y: auto; padding: .4rem; }
.conv-row { position: relative; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 14px; color: inherit; }
.conv-row:hover { background: var(--teal-50); text-decoration: none; }
.conv-row.active { background: var(--teal-50); }
.conv-row.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 4px; border-radius: 4px; background: var(--teal); }
.conv-ava { position: relative; flex: none; }
.conv-ava img, .conv-ava .avatar-fallback { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-weight: 800; font-size: 1.1rem; }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.conv-top b { font-size: .96rem; color: var(--ink); }
.conv-time { font-size: .7rem; white-space: nowrap; color: var(--muted); }
.conv-prev { font-size: .83rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-row.unread .conv-top b { font-weight: 800; }
.conv-row.unread .conv-prev { color: var(--ink); font-weight: 700; }
.conv-badge { background: var(--teal); color: #fff; min-width: 21px; height: 21px; border-radius: 11px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; padding: 0 6px; flex: none; }

/* Conversation pane */
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background-color: #eceefb; background-image: radial-gradient(rgba(91,91,214,.10) 1.5px, transparent 1.6px); background-size: 20px 20px; }
.chat-pane-empty { align-items: center; justify-content: center; }
.chat-placeholder { text-align: center; color: var(--muted); padding: 2rem; max-width: 340px; }
.cp-emoji { font-size: 3.4rem; margin-bottom: .6rem; }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.chat-back { display: none; font-size: 1.8rem; color: var(--ink); line-height: 1; padding: 0 .3rem; }
.chat-peer { display: flex; align-items: center; gap: .65rem; color: inherit; min-width: 0; }
.chat-peer:hover { text-decoration: none; }
.chat-peer-ava img, .chat-peer-ava .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-weight: 800; flex: none; }
.chat-peer-id { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.chat-peer-id .muted { font-size: .77rem; }
.chat-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; background: linear-gradient(120deg,#fff7ed,#fff); border-bottom: 1px solid #fed7aa; flex-wrap: wrap; }
.chat-banner p { margin: 0; }
.cb-actions { display: flex; gap: .5rem; }
.chat-note { padding: .7rem 1.1rem; background: var(--teal-50); color: var(--navy-600); font-size: .85rem; border-bottom: 1px solid var(--line); text-align: center; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 1.1rem 1.1rem 1.3rem; display: flex; flex-direction: column; }
.chat-messages { margin-top: auto; margin-inline: auto; width: 100%; max-width: 840px; display: flex; flex-direction: column; gap: .4rem; }
.chat-empty { text-align: center; margin: auto; color: var(--muted); }
.msg-row { display: flex; animation: msgIn .18s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; align-items: flex-end; gap: .45rem; }
.msg-ava { flex: 0 0 auto; align-self: flex-end; }
.msg-ava img, .msg-ava .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; font-size: .72rem; display: block; }
.msg-bubble { max-width: 74%; padding: .55rem .9rem; border-radius: 18px; font-size: .93rem; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(30,33,71,.06); }
.msg-row.theirs .msg-bubble { background: #fff; border: 1px solid var(--line); border-end-start-radius: 6px; color: var(--ink); }
.msg-row.mine .msg-bubble { background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; border-end-end-radius: 6px; }
.msg-row.mine .msg-bubble a { color: #fff; text-decoration: underline; }
.msg-time { display: block; font-size: .62rem; opacity: .65; margin-top: 3px; text-align: end; }
.chat-compose { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-top: 1px solid var(--line); background: #fff; }
#chat-input { flex: 1; border: 1.5px solid var(--line); border-radius: 24px; padding: .7rem 1.1rem; font: inherit; background: var(--bg); transition: .15s; }
#chat-input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px var(--teal-50); }
.chat-send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-size: 1.15rem; cursor: pointer; flex: none; display: grid; place-items: center; transition: .15s; }
.chat-send:hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(91,91,214,.4); }
.chat-compose-locked { opacity: .9; }
.chat-compose-locked input { flex: 1; border: 1.5px dashed var(--line); border-radius: 24px; padding: .7rem 1.1rem; font: inherit; background: #f1f2f8; color: var(--muted); cursor: not-allowed; }
.chat-compose-locked .lock-ico { font-size: 1.2rem; }

/* Conversation settings dropdown (⚙️ in the thread header) */
.chat-settings { margin-inline-start: auto; position: relative; }
.chat-settings > summary { list-style: none; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; font-size: 1.2rem; }
.chat-settings > summary::-webkit-details-marker, .chat-settings > summary::marker { display: none; content: ""; }
.chat-settings > summary:hover { background: var(--teal-50); }
.chat-settings[open] > summary { background: var(--teal-50); }
.cs-menu { position: absolute; inset-inline-end: 0; top: 48px; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(15,18,40,.18); min-width: 230px; padding: .4rem; display: flex; flex-direction: column; }
.cs-menu a, .cs-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: start; padding: .7rem .8rem; border: 0; background: none; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; color: var(--navy); }
.cs-menu a:hover, .cs-menu button:hover { background: var(--teal-50); text-decoration: none; }
.cs-menu .danger { color: #e11d48; }
.cs-menu form { display: block; width: 100%; margin: 0; }
.cs-sep { height: 1px; background: var(--line); margin: .3rem .4rem; }
.cs-menu .report-reasons { display: flex; flex-direction: column; gap: .25rem; padding: .2rem; }
.cs-menu .report-reasons button { padding: .5rem .7rem; font-size: .85rem; }

/* Info panel (3rd column on wide screens — fills the space usefully) */
.chat-aside { border-inline-start: 1px solid var(--line); background: #fff; overflow-y: auto; padding: 1.6rem 1.3rem; }
.ca-profile { text-align: center; }
.ca-ava img, .ca-ava .avatar-fallback { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-weight: 800; font-size: 2.4rem; margin: 0 auto .7rem; }
.ca-name { font-size: 1.22rem; margin: 0; display: flex; align-items: center; justify-content: center; gap: .3rem; flex-wrap: wrap; color: var(--navy); }
.ca-handle { font-size: .85rem; margin-bottom: .3rem; }
.ca-headline { margin: .5rem 0 .2rem; font-weight: 600; color: var(--ink); }
.ca-bio { font-size: .85rem; line-height: 1.65; }
.ca-stats { display: flex; justify-content: center; gap: 1.4rem; margin: 1.1rem 0; padding: .9rem 0; border-block: 1px solid var(--line); }
.ca-stats a, .ca-stats div { display: flex; flex-direction: column; gap: 2px; color: inherit; }
.ca-stats a:hover { text-decoration: none; }
.ca-stats b { font-size: 1.15rem; color: var(--navy); }
.ca-stats span { font-size: .72rem; color: var(--muted); }
.ca-actions { display: flex; flex-direction: column; gap: .55rem; }
.ca-actions .btn { width: 100%; }
.ca-actions form { display: block; }

@media (max-width: 1100px) {
  .chat-shell.has-aside { grid-template-columns: 340px minmax(0, 1fr); }
  .chat-aside { display: none; }
}

/* Requests + friends lists */
.req-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.req-row:last-child { border-bottom: 0; }
.req-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.person-card { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.container.narrow { max-width: 660px; }

/* Live toasts (new message / notification while browsing) */
.live-toasts { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 400; display: flex; flex-direction: column; gap: .5rem; max-width: 320px; }
.live-toast { background: var(--navy); color: #fff; padding: .75rem 1.1rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(15,18,40,.3); font-weight: 700; font-size: .9rem; transform: translateY(16px); opacity: 0; transition: .3s ease; }
.live-toast.show { transform: none; opacity: 1; }
a.live-toast:hover { text-decoration: none; background: var(--navy-600); }
@media (max-width: 820px) { .live-toasts { bottom: 78px; inset-inline: 12px auto; } }

@media (max-width: 820px) {
  .chat-main-wrap { width: 100%; padding: 0; }
  .chat-shell, .chat-shell.has-aside { grid-template-columns: 1fr; height: calc(100dvh - 54px); margin: 0; border-radius: 0; border: 0; box-shadow: none; }
  .chat-shell.show-list .chat-pane { display: none; }
  .chat-shell.show-thread .chat-sidebar { display: none; }
  .chat-back { display: block; }
  .msg-bubble { max-width: 84%; }
  /* touch-friendly + avoid iOS zoom on focus */
  #chat-input { font-size: 16px; padding: .75rem 1rem; }
  .chat-head { padding: .5rem .6rem; gap: .5rem; }
  .chat-peer-ava img, .chat-peer-ava .avatar-fallback { width: 40px; height: 40px; }
  .chat-send { width: 44px; height: 44px; }
  .chat-settings > summary { width: 44px; height: 44px; }
  .cs-menu { min-width: 210px; }
  .chat-sidebar-head { padding: .9rem 1rem; }
  .conv-row { padding: .8rem .7rem; }
  .reel-rail-btn, .chat-back { -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 420px) {
  .cs-menu { position: fixed; inset-inline: 10px 10px; inset-block-start: 64px; min-width: 0; }
  .msg-bubble { max-width: 88%; }
}

/* ===== Facebook-style coloured post backgrounds ===== */
.pbg-bg1 { background: radial-gradient(circle at 78% 18%, rgba(255,255,255,.18), transparent 42%), linear-gradient(135deg, #6366f1, #4338ca); }
.pbg-bg2 { background: radial-gradient(circle at 20% 22%, rgba(255,255,255,.2), transparent 42%), linear-gradient(135deg, #fb7185, #e11d48); }
.pbg-bg3 { background: radial-gradient(circle at 80% 80%, rgba(255,255,255,.18), transparent 45%), linear-gradient(135deg, #34d399, #0891b2); }
.pbg-bg4 { background: radial-gradient(circle at 25% 80%, rgba(255,255,255,.22), transparent 45%), linear-gradient(135deg, #fbbf24, #db2777); }
.pbg-bg5 { background-color: #0f172a; background-image: radial-gradient(rgba(255,255,255,.14) 1.3px, transparent 1.4px); background-size: 18px 18px; }

/* feed card on a coloured background */
.fp-bgpost { display: grid; place-items: center; min-height: 248px; border-radius: 16px; padding: 2.2rem 1.6rem; margin: .55rem 0; text-align: center; color: #fff; font-weight: 800; font-size: 1.7rem; line-height: 1.6; word-break: break-word; }
.fp-bgpost.long { font-size: 1.2rem; min-height: 210px; }
.fp-bgpost:hover { text-decoration: none; color: #fff; }
.fp-bgpost span { text-shadow: 0 1px 10px rgba(0,0,0,.22); max-width: 100%; }

/* composer live preview + swatch picker */
.composer-row.has-bg { border-radius: 14px; min-height: 172px; padding: 1.4rem; display: grid; place-items: center; margin-bottom: .4rem; transition: .2s; }
.composer-row.has-bg .composer-avatar, .composer-row.has-bg > .avatar-fallback { display: none; }
.composer-row.has-bg textarea { background: transparent; color: #fff; text-align: center; font-size: 1.4rem; font-weight: 800; resize: none; }
.composer-row.has-bg textarea::placeholder { color: rgba(255,255,255,.85); }
.bg-picker { display: flex; gap: .5rem; padding: .2rem 0 .7rem; flex-wrap: wrap; align-items: center; }
.bg-swatch { width: 38px; height: 38px; border-radius: 11px; border: 2px solid transparent; cursor: pointer; padding: 0; flex: none; }
.bg-swatch.active { border-color: var(--navy); box-shadow: 0 0 0 2px #fff inset; }
.bg-none { background: #fff; border: 2px solid var(--line); font-weight: 800; color: var(--navy); display: grid; place-items: center; font-size: .95rem; }

/* ===== Jobs (إعلان توظيف) ===== */
.company-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--teal-50); color: var(--teal-700); font-weight: 800; font-size: .8rem; padding: .28rem .85rem; border-radius: 999px; line-height: 1.4; }
.jobs-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.job-filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.job-filters a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line); color: var(--navy-600); font-weight: 600; font-size: .88rem; }
.job-filters a.active, .job-filters a:hover { background: var(--teal); color: #fff; border-color: var(--teal); text-decoration: none; }
.jobs-list { display: flex; flex-direction: column; gap: .8rem; }
.job-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; transition: .15s; }
.job-card:hover { border-color: var(--teal); box-shadow: 0 6px 20px rgba(30,33,71,.08); }
.job-logo img, .job-logo .avatar-fallback { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), var(--teal-700)); color: #fff; font-weight: 800; font-size: 1.3rem; flex: none; }
.job-logo.lg img, .job-logo.lg .avatar-fallback { width: 72px; height: 72px; border-radius: 16px; font-size: 1.85rem; }
.job-main { flex: 1; min-width: 0; }
.job-title { display: block; font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.job-title:hover { color: var(--teal-700); }
.job-company { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; }
.job-company a { color: var(--navy-600); font-weight: 600; }
.job-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .4rem; }
.job-badge { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .15rem .55rem; font-size: .78rem; font-weight: 600; color: var(--navy-600); }
.job-badge.type { background: var(--teal-50); color: var(--teal-700); border-color: transparent; }
.job-badge.salary { background: #ecfdf5; color: #047857; border-color: transparent; }
.job-time { font-size: .76rem; }
.job-apply-btn { flex: none; }
/* Similar jobs — a clearly SEPARATE section (title on the page, each job its own card) */
.similar-jobs { margin-top: 2.2rem; }
.similar-jobs-title { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 0 0 1rem; padding-bottom: .6rem; border-bottom: 2px solid var(--line); }
.similar-jobs-list { display: flex; flex-direction: column; gap: .7rem; }
.similar-job-card { display: flex; align-items: center; gap: .85rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; color: inherit; transition: .15s; }
.similar-job-card:hover { text-decoration: none; border-color: var(--teal); box-shadow: 0 4px 14px rgba(30,33,71,.07); }
.sj-logo { flex: 0 0 auto; }
.sj-logo img, .sj-logo .avatar-fallback { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; font-size: .9rem; }
.sj-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.45; gap: 2px; }
.sj-text b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sj-text .muted { font-size: .82rem; }
.sj-arrow { flex: 0 0 auto; font-size: 1.15rem; color: var(--muted); transition: .15s; }
.similar-job-card:hover .sj-arrow { color: var(--teal-700); transform: translateX(-3px); }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
@media (max-width: 540px) { .job-card { flex-wrap: wrap; } .job-apply-btn { width: 100%; text-align: center; } }
/* account-type radio (registration + settings) renders inline, not full-width */
.form-field input[type=radio], .form-field input[type=checkbox] { width: auto; display: inline-block; margin-inline-end: .4rem; vertical-align: middle; accent-color: var(--teal); }
.form-field [id$="account_type"] { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .3rem 0; }
.form-field [id$="account_type"] label { font-weight: 600; cursor: pointer; }
.form-field [id$="account_type"] div { display: inline-flex; align-items: center; }

/* Infinite-scroll loader (replaces page numbers on the feed) */
.feed-sentinel { display: flex; justify-content: center; padding: 1.3rem; }
.feed-sentinel[hidden], .new-posts-pill[hidden] { display: none; }
.feed-spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: feedspin .7s linear infinite; }
@keyframes feedspin { to { transform: rotate(360deg); } }

/* ===== Form error UX + flash toasts + job applications ===== */
.req { color: #e11d48; font-weight: 800; }
.danger, .btn.danger { color: #e11d48; }
.form-error-summary { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1rem; }
.form-error-summary ul { margin: .4rem 0 0; padding-inline-start: 1.2rem; }
.form-error-summary a { color: #b91c1c; font-weight: 700; }
.form-field.has-error input, .form-field.has-error textarea, .form-field.has-error select { border-color: #e11d48; background: #fff6f6; }
.field-err { display: block; color: #e11d48; font-size: .82rem; margin-top: .3rem; font-weight: 600; }

.msg-toasts { position: fixed; top: 16px; inset-inline: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; gap: .5rem; pointer-events: none; }
.msg-toast { pointer-events: auto; display: flex; align-items: center; gap: .9rem; background: var(--navy); color: #fff; padding: .75rem 1.2rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(15,18,40,.3); font-weight: 700; font-size: .92rem; max-width: 92vw; transform: translateY(-16px); opacity: 0; transition: .3s; }
.msg-toast.show { transform: none; opacity: 1; }
.msg-toast.msg-success { background: #059669; }
.msg-toast.msg-error { background: #e11d48; }
.msg-toast.msg-info { background: var(--teal); }
.msg-toast-x { background: none; border: 0; color: rgba(255,255,255,.85); cursor: pointer; font-size: .95rem; flex: none; }

/* In-app confirm modal (replaces native confirm/alert) */
.app-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 1.2rem; background: rgba(15,18,40,.55); backdrop-filter: blur(3px); animation: appfade .15s ease; }
.app-modal[hidden] { display: none; }
.app-modal-box { background: var(--card); border-radius: 18px; box-shadow: 0 24px 70px rgba(15,18,40,.4); width: 100%; max-width: 380px; padding: 1.5rem 1.5rem 1.2rem; text-align: center; animation: apppop .18s ease; }
.app-modal-box p { margin: 0 0 1.25rem; font-size: 1.02rem; font-weight: 700; color: var(--ink); line-height: 1.7; }
.app-modal-actions { display: flex; gap: .6rem; }
.app-modal-actions .btn { flex: 1; min-height: 44px; justify-content: center; }
@keyframes appfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes apppop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* Applicants — clean, wide, well-organized cards */
.applicants-wrap { max-width: 920px; margin-inline: auto; }
.applicants-head { margin-bottom: .9rem; }
.applicants-list { display: flex; flex-direction: column; gap: 1rem; }
.applicant-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.applicant-card .ac-head { display: flex; align-items: center; gap: .85rem; }
.applicant-card .ac-id { display: flex; align-items: center; gap: .75rem; flex: 1 1 auto; min-width: 0; }
.applicant-card .ac-id img, .applicant-card .ac-id .avatar-fallback { width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; font-size: 1.05rem; }
.applicant-card .ac-idmeta { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.applicant-card .ac-name { font-weight: 800; font-size: 1.05rem; color: var(--ink); display: inline-flex; align-items: center; gap: .25rem; }
.applicant-card .ac-sub { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.applicant-card .ac-info { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .85rem; }
.applicant-card .ac-contact { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--teal-700); }
.applicant-cover { margin: .85rem 0 0; padding: .7rem .95rem; background: var(--bg); border-radius: 10px; font-size: .9rem; line-height: 1.65; white-space: pre-line; }
.ac-foot { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.ac-foot .ac-spacer { flex: 1 1 auto; }
.app-status { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; flex: 0 0 auto; white-space: nowrap; }
.app-pending { background: #fef9c3; color: #854d0e; }
.app-info { background: var(--teal-50); color: var(--teal-700); }
.app-ok { background: #dcfce7; color: #166534; }
.app-bad { background: #fee2e2; color: #b91c1c; }

/* profile ⋯ menu (full block / report) sits inline with the action buttons */
.prof-menu { margin-inline-start: 0; }
.prof-menu > summary { width: 42px; height: 42px; }

/* ===== CV / Résumé builder + tab ===== */
.cv-builder .page-head { margin-bottom: 1rem; }
.cv-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .cv-grid2 { grid-template-columns: 1fr; } }
.cv-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.cv-sec-head .edit-section-title { margin: 0; border: 0; padding: 0; }
.cv-list { display: flex; flex-direction: column; gap: .9rem; }
.cv-row { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1rem .4rem; background: var(--bg); }
.cv-row .cv-row-del { position: absolute; top: .6rem; inset-inline-start: .6rem; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #fee2e2; color: #b91c1c; cursor: pointer; font-size: .8rem; }
.cv-row .cv-row-del:hover { background: #fecaca; }
.cv-row label { display: block; font-weight: 600; font-size: .85rem; color: var(--navy); margin-bottom: .7rem; }
.cv-row input, .cv-row textarea { display: block; width: 100%; margin-top: .25rem; }
.cv-row .cv-check { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.cv-row .cv-check input { width: auto; margin: 0; accent-color: var(--teal); }
.cv-accent { display: flex; align-items: center; gap: .7rem; font-weight: 600; color: var(--navy); margin-top: .4rem; }
.cv-accent input[type=color] { width: 48px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.skill-input { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: .5rem; background: var(--card); }
.skill-input input { border: 0; outline: 0; flex: 1; min-width: 140px; padding: .3rem; font: inherit; background: transparent; }
.skill-chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--teal-50); color: var(--teal-700); font-weight: 700; font-size: .85rem; padding: .25rem .3rem .25rem .7rem; border-radius: 999px; }
.skill-chip button { border: 0; background: rgba(0,0,0,.08); color: inherit; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: .7rem; line-height: 1; }
.cv-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.cv-actions .btn { flex: 1; min-width: 200px; justify-content: center; }

.cv-show-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cv-show-title { margin: 0; }
.cv-show-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cv-frame { width: 100%; height: 80vh; max-height: 1000px; border: 1px solid var(--line); border-radius: 12px; background: #f1f1f4; }
.cv-owner-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cv-pin-badge { color: #059669; font-weight: 700; font-size: .85rem; }
.cv-empty { text-align: center; padding: 2.5rem 1.5rem; }
.cv-empty-icon { font-size: 3rem; }
.cv-empty h3 { margin: .5rem 0; }
.cv-empty p { max-width: 46ch; margin: 0 auto 1.2rem; }

.cv-post-card { display: flex; align-items: center; gap: .8rem; margin: .6rem 0; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(120deg, var(--teal-50), var(--card)); }
.cv-post-card:hover { border-color: var(--teal); text-decoration: none; }
.cv-post-ic { font-size: 1.8rem; flex: 0 0 auto; }
.cv-post-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cv-post-meta b { color: var(--navy); }
.cv-post-dl { font-size: 1.3rem; }

/* CV builder: template/lang choice, photo, interests */
.cv-choice { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.cv-choice div { margin: 0; }
.cv-choice label { display: inline-flex !important; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; cursor: pointer; font-weight: 600; margin: 0 !important; background: var(--card); }
.cv-choice input { width: auto !important; margin: 0; accent-color: var(--teal); }
.cv-choice label:has(input:checked) { border-color: var(--teal); background: var(--teal-50); color: var(--teal-700); }
.cv-photo-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cv-photo-prev { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--bg); border: 2px solid var(--line); display: grid; place-items: center; font-size: 1.6rem; }
.cv-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.cv-photo-field { flex: 1; min-width: 0; }
.cv-photo-field label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }

/* ===== CV builder: split layout + live preview ===== */
.cv-split { display: grid; grid-template-columns: minmax(0,1fr) 470px; gap: 1.6rem; align-items: start; margin: 1rem 0 3rem; }
.cv-prev-pane { position: sticky; top: 70px; }
.cv-prev-bar { font-weight: 800; color: var(--navy); margin-bottom: .6rem; }
.cv-paper-wrap { background: #e9eaf2; border-radius: 16px; padding: 16px; max-height: 84vh; overflow: auto; box-shadow: inset 0 2px 8px rgba(0,0,0,.06); }
@media (max-width: 1024px) {
  .cv-split { grid-template-columns: 1fr; }
  .cv-prev-pane { position: static; }
  .cv-paper-wrap { max-height: 70vh; }
}

.cv-paper { --ac: #4f46e5; background: #fff; box-shadow: 0 8px 28px rgba(16,32,46,.16); border-radius: 5px; overflow: hidden; color: #1f2340; line-height: 1.55; font-family: "IBM Plex Sans Arabic","Cairo",sans-serif; }
.pv-band { background: var(--ac); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.pv-photo { width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.7); overflow: hidden; flex: 0 0 auto; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; }
.pv-photo img { width: 100%; height: 100%; object-fit: cover; }
.pv-head { flex: 1; min-width: 0; }
.pv-name { font-size: 20px; font-weight: 800; line-height: 1.2; }
.pv-title { font-size: 11.5px; opacity: .96; margin-top: 1px; }
.pv-contact { font-size: 8.6px; opacity: .9; margin-top: 4px; word-break: break-word; }
.pv-body { padding: 15px 20px 22px; }
.pv-sec { margin-bottom: 13px; }
.pv-sec-t { font-weight: 800; font-size: 11.5px; color: #1f2340; padding-bottom: 4px; border-bottom: 1px solid #e6e7f1; margin-bottom: 7px; }
.pv-sec-t::before { content: ""; display: inline-block; width: 5px; height: 12px; background: var(--ac); border-radius: 2px; vertical-align: -1px; margin-inline-end: 7px; }
.pv-sum { font-size: 9.2px; color: #3a3f63; margin: 0; }
.pv-entry { margin-bottom: 8px; }
.pv-et { font-weight: 700; font-size: 9.6px; color: #20233f; }
.pv-em { font-size: 8px; color: #6b7191; margin-top: 1px; }
.pv-ed { font-size: 8.6px; color: #3a3f63; margin-top: 2px; }
.pv-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-pill { background: color-mix(in srgb, var(--ac) 14%, #fff); color: var(--ac); font-weight: 700; font-size: 8px; padding: 2.5px 8px; border-radius: 999px; }
.pv-line { font-size: 9px; color: #3a3f63; }
/* ATS look */
.cv-paper.ats .pv-band { background: #fff; color: #1f2340; border-bottom: 2px solid #222; padding-bottom: 11px; }
.cv-paper.ats .pv-photo { display: none; }
.cv-paper.ats .pv-title { color: #444; }
.cv-paper.ats .pv-contact { color: #555; opacity: 1; }
.cv-paper.ats .pv-sec-t::before { display: none; }
.cv-paper.ats .pv-sec-t { border-bottom-color: #ccc; }
.cv-paper.ats .pv-pill { background: none; color: #3a3f63; padding: 0; font-weight: 400; }
.cv-status { margin: -.3rem 0 1rem; }
.cv-frame-fallback { display: grid; place-items: center; gap: 1rem; height: 100%; padding: 2rem; text-align: center; }
object.cv-frame { display: block; }

/* ===== CV: bigger preview, 3 template looks, image view, share ===== */
.cv-split { grid-template-columns: minmax(0,1fr) 540px; }
@media (max-width: 1100px){ .cv-split { grid-template-columns: 1fr; } }
.cv-paper-wrap { max-height: 88vh; }
.cv-paper { font-size: 12px; }

/* ATS preview: centred, monochrome, ruled, no photo */
.cv-paper.ats .pv-band { background: #fff; color: #1e3a5f; padding: 22px 26px 14px; display: block; text-align: center; }
.cv-paper.ats .pv-photo { display: none; }
.cv-paper.ats .pv-name { font-size: 22px; letter-spacing: .5px; }
.cv-paper.ats .pv-title { color: #5b6079; letter-spacing: .5px; }
.cv-paper.ats .pv-contact { color: #5b6079; opacity: 1; border-top: 1px solid #d0d3df; border-bottom: 1px solid #d0d3df; padding: 6px 0; margin-top: 8px; }
.cv-paper.ats .pv-sec-t::before { display: none; }
.cv-paper.ats .pv-sec-t { color: #1e3a5f; border-bottom: 1px solid #c9ccda; }

/* Classic preview: left name + title, navy, thick header rule, no photo */
.cv-paper.classic .pv-band { background: #fff; color: #1e3a5f; padding: 22px 26px 12px; display: block; border-bottom: 2.5px solid #1e3a5f; }
.cv-paper.classic .pv-photo { display: none; }
.cv-paper.classic .pv-name { font-size: 24px; color: #1e3a5f; }
.cv-paper.classic .pv-title { color: #5b6079; letter-spacing: .4px; }
.cv-paper.classic .pv-contact { color: #5b6079; opacity: 1; margin-top: 5px; }
.cv-paper.classic .pv-sec-t::before { display: none; }
.cv-paper.classic .pv-sec-t { color: #1e3a5f; border-bottom: 1px solid #c9ccda; }

/* CV tab: rendered image */
.cv-image-view { background: #e9eaf2; border-radius: 14px; padding: 16px; text-align: center; }
.cv-image-view img { max-width: 760px; width: 100%; border-radius: 6px; box-shadow: 0 8px 28px rgba(16,32,46,.16); }

/* Share compose page */
.cv-share-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.4rem; align-items: start; }
@media (max-width: 700px){ .cv-share-grid { grid-template-columns: 1fr; } }
.cv-share-img { background: #e9eaf2; border-radius: 12px; padding: 12px; max-height: 70vh; overflow: auto; }
.cv-share-img img { width: 100%; border-radius: 5px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.cv-share-lbl { display: block; font-weight: 700; margin-bottom: .4rem; color: var(--navy); }
.cv-share-cap { width: 100%; resize: vertical; }
.cv-share-note { font-size: .85rem; color: var(--muted); margin-top: .7rem; }
.cv-share-note.warn { color: #92400e; }
.cv-share-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.cv-show-actions .danger { color: #b91c1c; }

/* ===== Gamification: levels, streaks, achievements, leaderboard ===== */
.level-chip { display: inline-flex; align-items: center; gap: .3rem; background: linear-gradient(135deg, var(--teal-50), #fff); color: var(--teal-700); border: 1px solid var(--teal-50); font-weight: 800; font-size: .8rem; padding: .26rem .8rem; border-radius: 999px; line-height: 1.4; }
.streak-chip { display: inline-flex; align-items: center; gap: .3rem; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-weight: 800; font-size: .8rem; padding: .26rem .8rem; border-radius: 999px; line-height: 1.4; }
.streak-pill { display: inline-flex; align-items: center; gap: .2rem; background: #fff7ed; color: #c2410c; font-weight: 800; font-size: .82rem; padding: .3rem .58rem; border-radius: 999px; border: 1px solid #fed7aa; white-space: nowrap; flex: 0 0 auto; }
.streak-pill:hover { background: #ffedd5; text-decoration: none; }
.auth { flex: 0 0 auto; }
.auth .ask-btn { white-space: nowrap; }
@media (max-width: 400px) { .streak-pill { display: none; } }

/* Achievements wall */
.ach-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem .4rem; }
.ach-badge { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; cursor: default; }
.badge-svg { width: 60px; height: 60px; display: block; filter: drop-shadow(0 3px 7px rgba(16,32,46,.28)); transition: transform .15s; }
.ach-badge:hover .badge-svg { transform: translateY(-3px) scale(1.08); }
.ach-name { font-size: .68rem; font-weight: 700; color: var(--navy-600); line-height: 1.2; }
.ach-badge.locked .badge-svg { filter: grayscale(1) brightness(.72) drop-shadow(0 2px 4px rgba(16,32,46,.14)); opacity: .42; }
.ach-badge.locked .ach-name { color: var(--muted); font-weight: 500; }

/* Who viewed + completion */
.wv-count { color: var(--teal-700); font-size: 1.05rem; }
.comp-bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .2rem 0 .7rem; }
.comp-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-700)); border-radius: 999px; }
.comp-missing { list-style: none; padding: 0; margin: 0 0 .8rem; font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: .25rem; }
.comp-missing li::before { content: "○ "; color: var(--accent); }

/* ===== In-feed profile suggestions (cover cards + hover mini-profile) ===== */
.feed-suggest { overflow: visible; }
.fs-top { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .95rem; }
.fs-top h3 { margin: 0; font-size: 1.06rem; }
.fs-sub { font-size: .8rem; }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; overflow: visible; }
.btn-soft { background: var(--teal-50); color: var(--teal-700); border-color: transparent; }
.btn-soft:hover { background: #e3e6fb; }

.fs-card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding-bottom: .8rem; display: flex; flex-direction: column; align-items: center; text-align: center; transition: box-shadow .16s, transform .16s; }
.fs-card:hover { box-shadow: 0 10px 26px rgba(16,32,46,.14); transform: translateY(-2px); z-index: 3; }
.fs-coverlink { display: block; width: 100%; position: relative; }
.fs-cover { display: block; height: 50px; border-radius: 14px 14px 0 0; background-size: cover; background-position: center; }
.fs-cover-ph { background: linear-gradient(120deg, var(--teal), var(--teal-700)); }
.fs-ava { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--card); background: var(--card); overflow: hidden; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(16,32,46,.18); }
.fs-ava img, .fs-ava .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: 1.05rem; }
.fs-name { margin-top: 27px; font-weight: 800; color: var(--ink); font-size: .9rem; line-height: 1.25; padding: 0 .4rem; }
.fs-name:hover { color: var(--teal-700); text-decoration: none; }
.fs-lvl { font-size: .74rem; font-weight: 700; color: var(--teal-700); margin-top: .12rem; }
.fs-reason { font-size: .7rem; color: var(--muted); margin: .12rem 0 .55rem; padding: 0 .35rem; min-height: 1.05em; }
.fs-act { padding: 0 .55rem; width: 100%; }
.fs-act .inline-form, .fs-act .btn { width: 100%; }

/* hover mini-profile popup */
.fs-hover { position: absolute; top: 100%; left: 50%; margin-top: 8px; width: 252px; max-width: 86vw;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 20px 48px rgba(16,32,46,.26); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(-50%) translateY(5px) scale(.96); transform-origin: top center;
  transition: opacity .16s ease, transform .16s ease; z-index: 60; }
.fs-hover::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.fs-hcover { display: block; height: 62px; border-radius: 16px 16px 0 0; background-size: cover; background-position: center; }
.fs-hava { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--card); background: var(--card); overflow: hidden; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(16,32,46,.2); }
.fs-hava img, .fs-hava .avatar-fallback { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: 1.3rem; }
.fs-hbody { padding: 34px .9rem .9rem; text-align: center; }
.fs-hname { font-weight: 800; color: var(--ink); font-size: 1rem; display: block; }
.fs-hname:hover { color: var(--teal-700); text-decoration: none; }
.fs-huser { font-size: .8rem; display: block; margin-top: .05rem; }
.fs-hhead { font-size: .8rem; color: var(--navy-600); margin: .4rem 0; line-height: 1.45; }
.fs-hlvl { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--teal-700); background: var(--teal-50); padding: .18rem .65rem; border-radius: 999px; margin: .25rem 0 .55rem; }
.fs-hstats { display: flex; justify-content: center; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: .75rem; font-size: .72rem; color: var(--muted); }
.fs-hstats b { display: block; font-size: 1rem; color: var(--ink); }
.fs-hact { display: flex; gap: .45rem; }
.fs-hact .inline-form { flex: 1; }
.fs-hact .btn { width: 100%; }

@media (hover: hover) {
  .fs-card:hover .fs-hover { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }
}
@media (hover: none) { .fs-hover { display: none; } }
@media (max-width: 480px) { .fs-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Question search page (live search + filters) ===== */
.qh-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.qsearch { max-width: 820px; margin-inline: auto; }
.qs-controls { display: flex; flex-direction: column; gap: .8rem; margin-bottom: .9rem; }
.qs-searchbar { position: relative; display: flex; align-items: center; }
.qs-searchbar .qs-ico { position: absolute; inset-inline-start: .9rem; font-size: 1.1rem; opacity: .7; pointer-events: none; }
#qs-input { width: 100%; padding: .85rem 2.6rem; border: 2px solid var(--line); border-radius: 14px; font: inherit; font-size: 1.05rem; background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s; }
#qs-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-50); background: #fff; }
.qs-spin { position: absolute; inset-inline-end: 1rem; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: qs-rot .6s linear infinite; }
@keyframes qs-rot { to { transform: rotate(360deg); } }
.qs-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.qs-filter { flex: 1 1 150px; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.qs-filter:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-50); }
.qs-resultbar { font-size: .85rem; margin: 0 .2rem .5rem; }
.qs-resultbar b { color: var(--teal-700); }
#qs-results { transition: opacity .15s; }

/* ===== Fresh vs already-seen divider ===== */
.feed-divider { display: flex; align-items: center; gap: .7rem; margin: .4rem 0; }
.feed-divider-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.feed-divider-label { flex: 0 0 auto; font-size: .76rem; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; white-space: nowrap; }

/* ===== Repost / quote-repost ===== */
.fp-repost-tag { color: var(--muted); font-size: .82rem; }
.fp-repost-embed { border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem; margin: .2rem 0 .5rem; background: var(--bg); }
.fpe-head { display: flex; align-items: center; gap: .45rem; color: var(--ink); }
.fpe-head:hover { text-decoration: none; }
.fpe-ava img, .fpe-ava .avatar-fallback { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; font-size: .64rem; }
.fpe-name { font-size: .88rem; }
.fpe-head .muted { font-size: .8rem; }
.fpe-title { display: block; font-weight: 700; color: var(--ink); margin: .35rem 0 .1rem; }
.fpe-title:hover { color: var(--teal-700); text-decoration: none; }
.fpe-body { font-size: .9rem; color: var(--navy-600); line-height: 1.7; margin: .25rem 0; }
.fpe-body p:first-child { margin-top: 0; }
.fpe-media { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: .4rem; display: block; }
.fpe-link { display: inline-block; margin-top: .4rem; font-size: .82rem; font-weight: 700; color: var(--teal-700); }

.fp-repost-wrap { position: relative; }
.fp-repost-wrap > summary { list-style: none; }
.fp-repost-wrap > summary::-webkit-details-marker { display: none; }
.fp-repost-wrap > summary:hover { color: var(--teal-700); }
.fp-repost-pop { position: absolute; inset-inline-start: 0; bottom: 1.9rem; z-index: 30; width: min(320px, 80vw); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(16,32,46,.2); padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.fp-repost-pop textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; font: inherit; font-size: .9rem; resize: vertical; outline: none; }
.fp-repost-pop textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-50); }
.fp-repost-pop .btn { align-self: flex-start; }

/* ===== Sidebar widgets — comfortable & readable (Facebook-like) ===== */
.feed-left, .feed-right { gap: .85rem; }
/* flatter cards, modest padding, but readable type */
.feed-left { padding: .6rem; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,32,46,.06); }
.feed-right .card { padding: .95rem 1rem; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,32,46,.06); }
.feed-right .card h3 { font-size: 1.2rem; font-weight: 800; color: var(--ink); margin: 0 0 .75rem; letter-spacing: -.01em; }
.feed-right .card > p.muted, .feed-right .card .muted { font-size: .88rem; }

/* who-to-follow: comfortable rows */
.who-card h3 { margin: 0 0 .65rem; }
.who-row { margin-bottom: .6rem; }
.who-row:last-child { margin-bottom: 0; }
.who-id img, .who-id .avatar-fallback { width: 42px; height: 42px; }
.who-meta b { font-size: 1.02rem; }
.who-meta .muted { font-size: .86rem; }
.who-row .btn-sm { padding: .38rem .85rem; font-size: .92rem; }

/* left rail: readable nav rows */
.rail-me { padding: .55rem .6rem; font-size: 1.1rem; }
.rail-me img, .rail-me .avatar-fallback { width: 42px; height: 42px; }
.rail-nav a { padding: .58rem .65rem; font-size: 1.06rem; font-weight: 600; }
.rail-title { font-size: .85rem; padding: 0 .65rem .3rem; }
.rail-sep { margin: .55rem 0; }

/* tag chips */
.feed-left .tags, .feed-right .tags { gap: .42rem; }
.feed-left .tag, .feed-right .tag { font-size: .9rem; padding: .2rem .7rem; }

/* ===== Profile header card (dark) + scrollable left rail ===== */
/* NB: .feed-left already gets display:flex/column from the layout rule above, and
   display:none on mobile — so only constrain its height here (don't re-set display,
   or we'd override the mobile hide). */
.feed-left { max-height: calc(100vh - 92px); }
.rail-me { flex: 0 0 auto; background: linear-gradient(135deg, #1e2147, #4f46e5); color: #fff; padding: .85rem .9rem; border-radius: 12px; margin-bottom: .15rem; font-weight: 800; box-shadow: 0 6px 16px rgba(30,33,71,.26); gap: .65rem; }
.rail-me:hover { background: linear-gradient(135deg, #262a55, #5b5bd6); filter: brightness(1.04); text-decoration: none; }
.rail-me .rail-me-name, .rail-me span { color: #fff; line-height: 1.25; }
.rail-me img, .rail-me .avatar-fallback { width: 44px; height: 44px; border: 2px solid rgba(255,255,255,.55); }
.rail-me .avatar-fallback { background: rgba(255,255,255,.22); color: #fff; }

/* scrollable nav area (grows; user can add more items) */
.rail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 3px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail-scroll::-webkit-scrollbar { width: 7px; }
.rail-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.rail-scroll::-webkit-scrollbar-thumb:hover { background: #c7c9de; }

/* ===== Modals (repost / share) + toast ===== */
body.modal-open { overflow: hidden; }
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(15,18,40,.55); display: grid; place-items: center; padding: 1rem; animation: ovIn .15s ease; }
.modal-overlay[hidden] { display: none; }
@keyframes ovIn { from { opacity: 0; } }
.modal-card { background: var(--card); border-radius: 16px; width: min(540px, 96vw); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.4); animation: mcIn .18s ease; }
@keyframes mcIn { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.modal-x { background: var(--bg); border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; color: var(--navy-600); }
.modal-x:hover { background: var(--line); }
.modal-foot { display: flex; justify-content: flex-end; padding: .8rem 1.1rem; border-top: 1px solid var(--line); }

.repost-modal #repost-form { padding: 1rem 1.1rem 0; }
.rpm-compose { display: flex; gap: .7rem; }
.rpm-ava img, .rpm-ava .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
#repost-body { flex: 1; border: 0; outline: none; resize: vertical; font: inherit; font-size: 1.05rem; min-height: 70px; background: transparent; padding-top: .4rem; }
.rpm-preview { margin: .4rem 0 1rem; }
.rpm-card { border: 1px solid var(--line); border-radius: 14px; padding: .7rem .85rem; background: var(--bg); }
.rpm-card-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.rpm-card-ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; font-size: .7rem; }
.rpm-card-text { font-size: .9rem; color: var(--navy-600); line-height: 1.6; }

.share-opts { display: flex; flex-direction: column; padding: .5rem; }
.share-opt { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border: 0; background: none; cursor: pointer; font: inherit; font-size: 1rem; color: var(--ink); border-radius: 12px; text-align: start; }
.share-opt:hover { background: var(--teal-50); }
.share-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: 1.1rem; flex: 0 0 auto; }

.share-friends { padding: .5rem; max-height: 60vh; overflow: auto; }
.share-friend { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; border: 0; background: none; cursor: pointer; font: inherit; border-radius: 12px; color: var(--ink); }
.share-friend:hover { background: var(--teal-50); }
.share-friend img, .share-friend .avatar-fallback { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.share-friend .sf-name { flex: 1; text-align: start; font-weight: 700; font-size: .95rem; }
.share-friend .sf-send { font-size: .82rem; font-weight: 700; color: #fff; background: var(--teal); padding: .3rem .8rem; border-radius: 999px; }
.share-friend[disabled] { opacity: .7; }

.psc { display: block; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; background: #fff; color: var(--ink); max-width: 280px; }
.psc:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(16,32,46,.12); }
.psc-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.psc-ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; font-size: .62rem; }
.psc-name { font-size: .85rem; }
.psc-text { display: block; font-size: .85rem; color: var(--navy-600); line-height: 1.55; }
.psc-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; margin-top: .4rem; display: block; }

.msg-bubble.has-share { background: #fff !important; border: 1px solid var(--line); color: var(--ink); }
.msg-share-lbl { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .35rem; }

.sv-shared { background: linear-gradient(150deg, #1e2147, #4f46e5); }
.sv-post { display: grid; place-items: center; gap: .6rem; padding: 1rem; }
.sv-post-lbl { color: rgba(255,255,255,.85); font-size: .95rem; font-weight: 700; }
.sv-post .psc { max-width: 340px; width: 92%; }
.story-shared { display: grid; place-items: center; background: linear-gradient(150deg, #1e2147, #4f46e5); }
.story-shared-ic { font-size: 2rem; }

.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 400; background: #1e2147; color: #fff; padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: .9rem; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: 0 8px 28px rgba(0,0,0,.3); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ===== Settings (tabbed) ===== */
.settings-wrap { max-width: 880px; margin-inline: auto; }
.settings-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.settings-tabs { display: flex; flex-direction: column; gap: .3rem; position: sticky; top: 90px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .5rem; box-shadow: var(--shadow); min-width: 0; }
.st-tab { text-align: start; padding: .7rem .8rem; border: 0; background: none; border-radius: 10px; cursor: pointer; font: inherit; font-size: .98rem; font-weight: 600; color: var(--navy-600); }
.st-tab:hover { background: var(--teal-50); }
.st-tab.active { background: var(--teal-50); color: var(--teal-700); font-weight: 800; }
.settings-panels { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem 1.5rem; box-shadow: var(--shadow); min-width: 0; }
.st-panel[hidden] { display: none; }
.st-h { font-size: 1.1rem; font-weight: 800; color: var(--ink); margin: 1.3rem 0 .85rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.st-panel .st-h:first-child { margin-top: 0; }
.st-hint { color: var(--muted); font-size: .85rem; margin: -.4rem 0 .85rem; }
.settings-actions { margin-top: 1.2rem; display: flex; justify-content: flex-end; }
.settings-actions[hidden] { display: none; }  /* class display:flex would otherwise beat [hidden] */
.bio-counter { text-align: end; font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.bio-counter.near { color: #c2410c; font-weight: 700; }
@media (max-width: 720px) { .settings-shell { grid-template-columns: minmax(0, 1fr); } .settings-tabs { flex-direction: row; overflow-x: auto; position: static; -webkit-overflow-scrolling: touch; } .st-tab { white-space: nowrap; flex: 0 0 auto; } }

/* ===== Avatar confirm/preview modal ===== */
.avatar-modal { width: min(380px, 94vw); }
.avm-body { padding: 1.3rem 1.2rem .6rem; text-align: center; }
.avm-preview { width: 200px; height: 200px; margin: 0 auto .85rem; border-radius: 30px; overflow: hidden; background: var(--bg); box-shadow: 0 4px 16px rgba(16,32,46,.16); }
.avm-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avm-hint { font-size: .85rem; margin: 0; }
.avm-foot { gap: .5rem; }

/* ===== Profile milestone posts (avatar/cover change) ===== */
.fp-evt { margin: .1rem 0 .3rem; }
.fp-evt-lbl { display: block; font-size: .92rem; color: var(--navy-600); font-weight: 600; margin-bottom: .55rem; }
.fp-evt-cover { display: block; height: clamp(150px, 22vw, 240px); border-radius: 14px; background-size: cover; background-position: center; background-color: #0b1b2b; }
.fp-evt-avatar { display: block; width: 180px; height: 180px; margin: .2rem auto .4rem; border-radius: 26px; overflow: hidden; border: 4px solid var(--card); box-shadow: 0 4px 16px rgba(16,32,46,.18); background: var(--bg); }
.fp-evt-avatar img, .fp-evt-avatar .avatar-fallback { width: 100%; height: 100%; object-fit: cover; font-size: 3rem; }

/* ===== Founder page distinction (emblem + shimmer + glow) ===== */
.founder-emblem { position: absolute; top: 14px; inset-inline-start: 16px; z-index: 4; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 999px; font-weight: 800; font-size: .92rem; color: #3b2606; background: linear-gradient(135deg, #fde68a, #f59e0b 55%, #fbbf24); box-shadow: 0 4px 16px rgba(180,83,9,.5); border: 1px solid #fff3c4; }
.founder-emblem .fe-crown { display: inline-block; animation: feBob 2.4s ease-in-out infinite; }
@keyframes feBob { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-2px) rotate(5deg); } }
/* Shimmer sweep across the founder ribbon */
.founder-ribbon.badge-founder { position: relative; overflow: hidden; }
.founder-ribbon.badge-founder::after { content: ""; position: absolute; top: 0; left: -60%; width: 55%; height: 100%; background: linear-gradient(110deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-18deg); animation: ribbonShine 3.4s ease-in-out infinite; }
@keyframes ribbonShine { 0% { transform: translateX(0) skewX(-18deg); } 55%,100% { transform: translateX(420%) skewX(-18deg); } }
/* Soft golden pulse on the founder avatar */
.is-founder .profile-avatar { animation: founderGlow 3s ease-in-out infinite; }
@keyframes founderGlow { 0%,100% { box-shadow: 0 0 0 4px rgba(245,158,11,.30), 0 8px 24px rgba(146,64,14,.3); } 50% { box-shadow: 0 0 0 7px rgba(245,158,11,.5), 0 10px 30px rgba(146,64,14,.45); } }
@media (prefers-reduced-motion: reduce) { .fe-crown, .founder-ribbon.badge-founder::after, .is-founder .profile-avatar { animation: none; } }

/* ===== Founder page: golden theme + watermark seal + official verification ===== */
body.founder-page { background-color: #fdf9ef;
  background-image:
    radial-gradient(circle at 50% -8%, rgba(245,158,11,.14), transparent 48%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cpath d='M30 95 L40 55 L60 82 L75 45 L90 82 L110 55 L120 95 Z' fill='none' stroke='%23caa024' stroke-width='3' stroke-opacity='0.07' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed; background-repeat: no-repeat, repeat; }
/* a single large faint crown 'seal' in the corner */
body.founder-page::after { content: "👑"; position: fixed; bottom: 5%; inset-inline-start: 4%; font-size: 17vmin; opacity: .05; z-index: -1; pointer-events: none; }

/* Official (gold) verification seal — replaces the blue tick for the founder */
.official-seal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706); color: #fff; font-size: .85rem; font-weight: 900; vertical-align: middle; margin-inline-start: .35rem; box-shadow: 0 2px 9px rgba(217,119,6,.55); border: 1.5px solid #fff3c4; }
.official-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .3rem .85rem; border-radius: 999px; font-weight: 800; font-size: .78rem; color: #7c4a02; background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #f59e0b; box-shadow: 0 2px 8px rgba(245,158,11,.3); }

/* Gold 'official' verification (founder) — applies everywhere the seal appears */
.badge-verified.official, .verified-seal.official { background: linear-gradient(135deg, #fde68a, #f59e0b 55%, #d97706); color: #fff; border: 1px solid #fff3c4; box-shadow: 0 1px 5px rgba(217,119,6,.5); }

/* Custom golden founder verified seal (scales with surrounding text) */
.gold-seal { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-inline-start: .18rem; filter: drop-shadow(0 1px 2px rgba(180,83,9,.4)); flex: 0 0 auto; }
.profile-name .gold-seal { width: 1.05em; height: 1.05em; }
.official-chip { color: #7c4a02; }
.official-chip .gold-seal { width: 1.2em; height: 1.2em; margin-inline-start: 0; vertical-align: -0.26em; filter: none; }

/* ===== Premium exclusive 'Gold Verified' chip (founder only) ===== */
.gold-verify-chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: .35rem; padding: .36rem .95rem .36rem .72rem; border-radius: 999px; font-weight: 800; font-size: .82rem; letter-spacing: -.01em; color: #5b2e02; background: linear-gradient(135deg, #fff7d6 0%, #fcd34d 46%, #f0a500 100%); border: 1px solid #fffbeb; box-shadow: 0 3px 12px rgba(217,119,6,.42), inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 5px rgba(146,64,14,.2); }
.gold-verify-chip .gvc-text { position: relative; z-index: 1; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.gold-verify-chip .gold-seal { width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin: 0; position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(146,64,14,.35)); }
.gold-verify-chip::after { content: ""; position: absolute; top: 0; left: -65%; width: 55%; height: 100%; background: linear-gradient(110deg, transparent, rgba(255,255,255,.85), transparent); transform: skewX(-18deg); animation: chipShine 3.8s ease-in-out infinite; }
@keyframes chipShine { 0% { transform: translateX(0) skewX(-18deg); } 50%,100% { transform: translateX(480%) skewX(-18deg); } }
@media (prefers-reduced-motion: reduce) { .gold-verify-chip::after { animation: none; } }

/* Story editor: faint sample caption (so the chosen text colour is visible) + color tools */
.sp-text.sp-text-sample { opacity: .55; font-style: italic; }
.text-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }
.color-tool { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.color-tool input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0; cursor: pointer; background: none; }
#story-color-reset { padding: .3rem .7rem; }

/* ===================================================================== */
/* Projects — "اعرض مشروعك" (Build in Public showcase)                    */
/* ===================================================================== */
.projects-wrap { max-width: 820px; margin-inline: auto; }
.projects-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.projects-hero .ph-text { flex: 1 1 280px; }
.projects-hero .page-title { margin-bottom: .25rem; }
.proj-tabs { margin-bottom: .8rem; }
.proj-filter { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.proj-filter .chip { font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--card); transition: .15s; }
.proj-filter .chip:hover { border-color: var(--teal); color: var(--teal-700); }
.proj-filter .chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }

.projects-list { display: flex; flex-direction: column; gap: .8rem; }
.project-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: .15s; }
.project-card:hover { border-color: var(--teal); box-shadow: 0 6px 20px rgba(30,33,71,.08); }
.pc-cover { flex: 0 0 76px; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg,#eef0ff,#e6fbf5); display: flex; align-items: center; justify-content: center; }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-cover-ph { font-size: 2rem; }
.pc-body { flex: 1 1 auto; min-width: 0; }
.pc-title { font-size: 1.12rem; font-weight: 800; color: var(--ink); display: inline-block; }
.pc-title:hover { color: var(--teal-700); }
.pc-tagline { color: var(--muted); margin: .15rem 0 .5rem; line-height: 1.5; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; }
.pc-maker { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); font-weight: 600; }
.pc-maker img, .pc-maker .avatar-fallback { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; font-size: .7rem; }
.pc-seeking { background: var(--teal-50); color: var(--teal-700); font-weight: 700; font-size: .74rem; padding: .15rem .55rem; border-radius: 999px; }
.pc-comments { white-space: nowrap; }

/* Product-Hunt-style upvote button */
.upvote-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; flex: 0 0 auto; min-width: 58px; padding: .5rem .4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); cursor: pointer; font: inherit; line-height: 1; transition: .15s; }
.upvote-btn .uv-arrow { font-size: 1rem; }
.upvote-btn .uv-count { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.upvote-btn:hover { border-color: var(--teal); color: var(--teal-700); }
.upvote-btn.on { border-color: var(--teal); background: var(--teal); color: #fff; }
.upvote-btn.on .uv-count { color: #fff; }
.upvote-btn.pop { animation: likePop .32s ease; }

/* Project detail */
.project-detail .pd-head { display: flex; gap: 1.2rem; align-items: flex-start; }
.pd-cover { flex: 0 0 120px; width: 120px; height: 120px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg,#eef0ff,#e6fbf5); display: flex; align-items: center; justify-content: center; }
.pd-cover img { width: 100%; height: 100%; object-fit: cover; }
.pd-headmain { flex: 1 1 auto; min-width: 0; }
.pd-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.pd-title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.pd-menu summary { list-style: none; cursor: pointer; padding: .2rem .5rem; border-radius: 8px; }
.pd-tagline { color: var(--muted); font-size: 1.05rem; margin: .35rem 0 .6rem; line-height: 1.6; }
.pd-byline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .88rem; margin-bottom: .9rem; }
.pd-maker { display: inline-flex; align-items: center; gap: .4rem; }
.pd-maker img, .pd-maker .avatar-fallback { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; font-size: .72rem; }
.pd-stage { font-size: .74rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: #eef0ff; color: #4f46e5; }
.pd-stage.stage-live { background: #e6fbf5; color: #0f766e; }
.pd-stage.stage-wip { background: #fff7ed; color: #c2410c; }
.pd-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.pd-actions .upvote-btn { flex-direction: row; min-width: 0; padding: .45rem .9rem; }
.pd-stat { white-space: nowrap; }
.pd-desc { margin-top: 1.2rem; }
.pd-tags { margin-top: 1rem; }

@media (max-width: 560px) {
  .project-card { gap: .7rem; padding: .8rem; }
  .pc-cover { flex-basis: 60px; width: 60px; height: 60px; }
  .project-detail .pd-head { flex-direction: column; }
  .pd-cover { width: 88px; height: 88px; }
}

/* Job application — CV attach + file chips */
.cv-attach-row { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; font-weight: 600; }
.cv-attach-row input[type=checkbox] { margin-top: .25rem; width: 18px; height: 18px; flex: 0 0 auto; }
.cv-attach-link { display: inline-block; margin-top: .4rem; font-size: .85rem; }
.cv-attach-hint { background: var(--teal-50); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; }
.applicant-files { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.file-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; padding: .35rem .8rem; border: 1px solid var(--teal); color: var(--teal-700); border-radius: 999px; background: var(--teal-50); transition: .15s; }
.file-chip:hover { background: var(--teal); color: #fff; }
.applicant-contact { font-size: .88rem; margin: .2rem 0; }

/* Job-application private thread */
.app-thread-wrap { display: flex; flex-direction: column; gap: .8rem; }
.app-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; }
.app-thread-head .who-id { display: flex; align-items: center; gap: .6rem; }
.app-thread-head img, .app-thread-head .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.app-thread-head .who-meta { display: flex; flex-direction: column; }
.app-thread { padding: 1rem; }
.app-thread .msg-list { display: flex; flex-direction: column; gap: .5rem; max-height: 56vh; overflow-y: auto; padding: .3rem; margin-bottom: .8rem; }
.app-thread .msg-row { display: flex; }
.app-thread .msg-row.mine { justify-content: flex-start; }      /* mine on the start (RTL right) */
.app-thread .msg-row.theirs { justify-content: flex-end; }
.app-thread .msg-bubble .msg-time { display: block; font-size: .68rem; opacity: .7; margin-top: .2rem; }
.app-thread-compose { display: flex; gap: .5rem; align-items: center; border-top: 1px solid var(--line); padding-top: .8rem; }
.app-thread-compose .reply-input { flex: 1 1 auto; }
.unread-badge { display: inline-block; min-width: 18px; padding: 0 .35rem; font-size: .7rem; line-height: 18px; text-align: center; background: #e11d48; color: #fff; border-radius: 999px; }

/* Applicants list — compact clickable cards */
.applicant-card.ac-clickable { display: block; text-decoration: none; color: inherit; transition: .15s; }
.applicant-card.ac-clickable:hover { border-color: var(--teal); box-shadow: 0 6px 20px rgba(30,33,71,.08); }
.applicant-card .ac-head { align-items: center; }
.ac-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.ac-tag { font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: var(--bg); color: var(--navy-600); border: 1px solid var(--line); }
.ac-tag-unread { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.ac-end { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: 0 0 auto; }
.ac-open { font-size: .8rem; white-space: nowrap; }
.applicant-card.ac-clickable:hover .ac-open { color: var(--teal-700); }

/* Application detail — full submission */
.app-detail { padding: 1.4rem 1.5rem; }
.app-detail .ad-head { display: flex; align-items: flex-start; gap: 1rem; }
.ad-avatar img, .ad-avatar .avatar-fallback { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; font-size: 1.3rem; }
.ad-id { flex: 1 1 auto; min-width: 0; }
.ad-name { font-size: 1.3rem; font-weight: 800; margin: 0; display: inline-flex; align-items: center; gap: .3rem; }
.ad-name a { color: var(--ink); }
.ad-headline { margin: .25rem 0; color: var(--navy-600); font-weight: 600; }
.ad-sub { font-size: .85rem; margin: .15rem 0 0; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; padding: .7rem .95rem; background: var(--bg); border-radius: 10px; font-size: .9rem; font-weight: 600; }
.ad-section { margin-top: 1.3rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.ad-section h3 { font-size: 1rem; margin: 0 0 .7rem; }
.ad-cover { background: var(--bg); border-radius: 10px; padding: .9rem 1.1rem; line-height: 1.8; white-space: pre-line; }
.ad-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.ad-actions .ac-spacer { flex: 1 1 auto; }
@media (max-width: 560px) {
  .app-detail .ad-head { flex-wrap: wrap; }
  .ad-actions .ac-spacer { display: none; }
}

/* Job application builder (company side) */
.app-builder { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; }
.app-builder > label { display: block; font-weight: 700; margin-bottom: .7rem; }
.ab-group { margin-top: .8rem; }
.ab-title { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .5rem; color: var(--navy-600); }
.ab-checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.ab-check label, .ab-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .88rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; }
.ab-check input { accent-color: var(--teal); }
.ab-custom { margin-top: .5rem; }
.ab-custom input { width: 100%; }

/* Applicant side — requested fields grid */
.apply-requested .ar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.apply-requested .ar-grid .form-field { margin: 0; }
.apply-question { margin-top: .6rem; }

/* Company side — answers in application detail */
.ad-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.ad-answer { display: flex; flex-direction: column; gap: .15rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; }
.ad-answer .ada-label { font-size: .78rem; font-weight: 700; color: var(--navy-600); }
.ad-answer .ada-val { font-weight: 600; word-break: break-word; }
.ad-answer a.ada-val { color: var(--teal-700); }
.ad-qa { margin-top: .9rem; display: flex; flex-direction: column; gap: .8rem; }
.ad-qaitem .adq { display: block; font-size: .92rem; margin-bottom: .25rem; }
.ad-qaitem .ada { margin: 0; background: var(--bg); border-radius: 8px; padding: .55rem .8rem; line-height: 1.7; }

/* ===================================================================== */
/* Job detail — baaeed-style two-column layout                            */
/* ===================================================================== */
.jobd-wrap { max-width: 1080px; margin-inline: auto; }
.jobd-title { font-size: 1.7rem; font-weight: 800; color: var(--ink); margin: .3rem 0 1.2rem; letter-spacing: -.01em; }
.jobd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.4rem; align-items: start; }
.jobd-main { min-width: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.jobd-desc { padding: 1.4rem 1.6rem; }
.jobd-h { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 0 0 1rem; padding-bottom: .7rem; border-bottom: 2px solid var(--line); }
.jobd-desc .entry-body { line-height: 1.9; }

/* Sidebar */
.jobd-side { display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 80px; }
.jobd-card, .jobd-company { padding: 1.2rem 1.3rem; }
.jobd-card-h { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin: 0 0 .6rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.jobd-rows { display: flex; flex-direction: column; }
.jobd-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .62rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.jobd-row:last-child { border-bottom: 0; }
.jobd-k { color: var(--muted); font-weight: 600; flex: 0 0 auto; }
.jobd-v { font-weight: 700; color: var(--ink); text-align: end; min-width: 0; overflow-wrap: anywhere; }
.jobd-title { overflow-wrap: anywhere; }
.jobd-v .app-status { font-size: .72rem; }
.jobd-skills { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.jobd-skills .jobd-k { display: block; margin-bottom: .55rem; }
.jobd-skills .tags { gap: .4rem; }

.jobd-cta { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.jobd-btn { width: 100%; justify-content: center; }
.jobd-cta-row { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.jobd-applied { text-align: center; font-size: .95rem; padding: .5rem; }

/* Company card */
.jobd-company-id { display: flex; align-items: center; gap: .7rem; }
.jobd-company-logo img, .jobd-company-logo .avatar-fallback { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.jobd-company-meta { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.jobd-company-meta b { color: var(--ink); }
.jobd-company-meta .muted { font-size: .82rem; }
.jobd-company-link { display: inline-block; margin-top: .9rem; font-size: .88rem; font-weight: 600; color: var(--teal-700); }

@media (max-width: 860px) {
  .jobd-layout { grid-template-columns: 1fr; }
  .jobd-side { position: static; }
  .jobd-title { font-size: 1.4rem; }
}

.jobs-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.jobd-cta .jobd-btn-form { width: 100%; }

/* ===================================================================== */
/* Admin control panel (لوحة التحكم)                                      */
/* ===================================================================== */
.dash-layout { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 1.4rem; align-items: start; max-width: 1180px; margin-inline: auto; }
.dash-side { position: sticky; top: 80px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; box-shadow: var(--shadow); }
.dash-brand { font-size: 1.1rem; font-weight: 800; margin: 0 0 1rem; }
.dash-nav { display: flex; flex-direction: column; gap: .3rem; }
.dash-nav a { padding: .6rem .8rem; border-radius: 10px; font-weight: 600; color: var(--navy-600); }
.dash-nav a:hover { background: var(--teal-50); }
.dash-nav a.active { background: var(--teal); color: #fff; }
.dash-back { display: inline-block; margin-top: 1rem; font-size: .85rem; }
.dash-main { min-width: 0; }
.dash-h { font-size: 1.1rem; font-weight: 800; margin: 1.6rem 0 .8rem; }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: .8rem; }
.dash-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); text-align: center; }
.dash-stat b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--ink); }
.dash-stat span { font-size: .82rem; color: var(--muted); }
.dash-stat.ok b { color: #0f766e; }
.dash-stat.danger b { color: #e11d48; }

.dash-recent { padding: .4rem .6rem; }
.dash-recent-row { display: flex; align-items: center; gap: .7rem; padding: .6rem; border-bottom: 1px solid var(--line); color: inherit; }
.dash-recent-row:last-child { border-bottom: 0; }
.dash-recent-row:hover { background: var(--bg); }
.dash-recent-row img, .dash-recent-row .avatar-fallback { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.drr-meta { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }

.dash-search { display: flex; gap: .5rem; margin-bottom: .9rem; }
.dash-search input { flex: 1 1 auto; }
.dash-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.dash-filters a { font-size: .85rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.dash-filters a.active, .dash-filters a:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

.dash-users { padding: .3rem .6rem; }
.dash-user-row { display: flex; align-items: center; gap: 1rem; padding: .75rem .4rem; border-bottom: 1px solid var(--line); }
.dash-user-row:last-child { border-bottom: 0; }
.dash-user-row.is-banned { opacity: .6; }
.du-id { display: flex; align-items: center; gap: .7rem; flex: 1 1 auto; min-width: 0; color: inherit; }
.du-id img, .du-id .avatar-fallback { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.du-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.du-meta b { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.du-meta .muted { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.du-sub { font-size: .78rem !important; }
.du-tag { font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--bg); color: var(--navy-600); border: 1px solid var(--line); }
.du-tag.ok { background: #e6fbf5; color: #0f766e; border-color: #99f6e4; }
.du-tag.staff { background: #eef0ff; color: #4f46e5; border-color: #c7d2fe; }
.du-tag.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.du-actions { position: relative; flex: 0 0 auto; }
.du-actions summary { list-style: none; cursor: pointer; padding: .3rem .6rem; border-radius: 8px; font-size: 1.2rem; }
.du-actions summary:hover { background: var(--bg); }
.du-menu { position: absolute; inset-inline-end: 0; top: 100%; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16,32,46,.16); padding: .4rem; min-width: 190px; display: flex; flex-direction: column; gap: .15rem; }
.du-menu button, .du-menu form { width: 100%; }
.du-menu button { text-align: start; background: none; border: 0; padding: .5rem .7rem; border-radius: 8px; cursor: pointer; font: inherit; font-size: .88rem; }
.du-menu button:hover { background: var(--bg); }
.du-menu button.danger { color: #e11d48; }
.du-badge-form select { width: 100%; padding: .4rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; font-size: .85rem; margin: .15rem 0; }

@media (max-width: 820px) { .dash-layout { grid-template-columns: 1fr; } .dash-side { position: static; } }

/* Security questions / trusted devices */
.ok-note { background: #e6fbf5; border: 1px solid #99f6e4; color: #0f766e; border-radius: 10px; padding: .6rem .9rem; font-size: .9rem; margin-bottom: 1rem; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.device-row:last-child { border-bottom: 0; }
.dev-meta { display: flex; flex-direction: column; line-height: 1.4; }
.dev-meta .muted { font-size: .82rem; }

/* ===================================================================== */
/* Admin control panel — standalone shell                                 */
/* ===================================================================== */
.admin-body { background: var(--bg); font-family: 'Cairo', sans-serif; margin: 0; color: var(--ink); }
.admin-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.4rem; background: linear-gradient(135deg, #1e2147, #2d2f6e); color: #fff; box-shadow: 0 2px 12px rgba(16,32,46,.18); }
.admin-brand { font-weight: 800; font-size: 1.05rem; }
.admin-user { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.admin-user .btn { color: #fff; border-color: rgba(255,255,255,.3); }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 1.4rem; max-width: 1240px; margin: 1.4rem auto; padding: 0 1.2rem; align-items: start; }
.admin-side { position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: var(--shadow); }
.admin-main { min-width: 0; }
.admin-msgs { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.admin-msg { padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.admin-msg.admin-success { background: #e6fbf5; color: #0f766e; border-color: #99f6e4; }
.admin-msg.admin-error { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.admin-msg.admin-info { background: #eef0ff; color: #4f46e5; border-color: #c7d2fe; }

.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.4rem; }
.admin-login { width: min(420px, 100%); padding: 2rem; }
.admin-login h1 { font-size: 1.4rem; margin: 0 0 .3rem; }

.admin-alert { display: block; background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; border-radius: 12px; padding: .85rem 1.1rem; font-weight: 600; margin: 1.2rem 0; }
.admin-alert:hover { background: #ffedd5; }

/* Reports */
.report-list { display: flex; flex-direction: column; gap: .8rem; }
.report-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.rc-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; }
.rc-kind { font-weight: 800; background: var(--bg); padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--line); }
.rc-reason { font-weight: 700; color: #c2410c; }
.rc-text { margin: .6rem 0 .4rem; line-height: 1.6; }
.rc-text a { color: var(--ink); }
.rc-sub { font-size: .82rem; }
.rc-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--line); }

.du-reports { flex: 0 0 auto; font-size: .8rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; background: #fee2e2; color: #b91c1c; }
.du-reports.muted { background: var(--bg); color: var(--muted); font-weight: 600; }
.du-menu-link { display: block; padding: .5rem .7rem; border-radius: 8px; font-size: .88rem; color: var(--ink); }
.du-menu-link:hover { background: var(--bg); }

/* Admins & permissions */
.admin-cards { display: flex; flex-direction: column; gap: 1rem; }
.admin-card { padding: 1.1rem 1.2rem; }
.admin-card.dimmed { opacity: .65; }
.ac-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: .5rem .9rem; }
.perm-grid label { display: flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; }
.perm-grid .perm-super { grid-column: 1 / -1; font-weight: 700; color: #4f46e5; }
.ac-foot { margin-top: .9rem; display: flex; gap: .5rem; }

@media (max-width: 820px) { .admin-shell { grid-template-columns: 1fr; } .admin-side { position: static; } }

/* Team verification (green, professional) — the labeled badge handles team; the
   standalone .badge-team circle was removed (it collided with the labeled pill). */
.team-pill { display: inline-flex; align-items: center; gap: .2rem; font-size: .72rem; font-weight: 800; padding: .12rem .55rem; border-radius: 999px; background: #d1fae5; color: #047857; border: 1px solid #6ee7b7; }
.btn-team { background: linear-gradient(135deg, #10b981, #059669) !important; color: #fff !important; border-color: #059669 !important; }
.btn-team:hover { filter: brightness(1.05); }
.verify-actions { display: flex; gap: .4rem; flex-wrap: wrap; flex: 0 0 auto; }

.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 .3rem; border-radius: 999px; background: #e11d48; color: #fff; font-size: .68rem; font-weight: 800; margin-inline-start: .25rem; }
.nav-badge.pulse { animation: likePop .5s ease 3; }

.perm-group { margin: .7rem 0; padding-top: .6rem; border-top: 1px dashed var(--line); }
.perm-group-h { font-weight: 800; font-size: .85rem; color: var(--navy-600); margin-bottom: .4rem; }
.perm-active { display: flex; align-items: center; gap: .45rem; margin-top: .8rem; font-weight: 700; font-size: .9rem; }

.log-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.log-table th, .log-table td { text-align: start; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.log-table th { font-size: .78rem; color: var(--muted); }
.log-action { font-weight: 700; background: var(--bg); padding: .12rem .5rem; border-radius: 6px; font-size: .8rem; }

.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .9rem; }
.story-mon { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.sm-media { height: 150px; background: #111; display: flex; align-items: center; justify-content: center; }
.sm-media img, .sm-media video { width: 100%; height: 100%; object-fit: cover; }
.sm-ph { font-size: 2rem; }
.sm-meta { padding: .5rem .6rem; display: flex; flex-direction: column; gap: .15rem; font-size: .82rem; }
.sm-cap { font-size: .78rem; }
.story-mon form { padding: 0 .6rem .6rem; }

.mon-thread { display: flex; flex-direction: column; gap: .5rem; max-height: 65vh; overflow-y: auto; }
.mon-msg { padding: .5rem .7rem; background: var(--bg); border-radius: 8px; font-size: .9rem; line-height: 1.6; }
.mon-msg .mon-time { display: block; font-size: .72rem; margin-top: .2rem; }

/* Report snapshot (preserved content shown inline) */
.report-card.rc-deleted { border-color: #fecaca; background: #fffafa; }
.rc-snapshot { display: flex; gap: .9rem; margin: .7rem 0; align-items: flex-start; }
.rc-media { flex: 0 0 auto; }
.rc-media img, .rc-media video { width: 130px; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #000; }
.rc-body { flex: 1 1 auto; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; line-height: 1.7; white-space: pre-line; word-break: break-word; max-height: 240px; overflow-y: auto; }
/* Story monitor extras */
.sm-actions { display: flex; gap: .4rem; padding: 0 .6rem .6rem; }
.sm-textonly { display: flex; align-items: center; justify-content: center; height: 100%; padding: .6rem; color: #fff; font-weight: 700; text-align: center; }
.sm-media { position: relative; }
.sm-overlay-cap { position: absolute; inset-inline: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: .8rem; padding: .5rem; }
/* Q&A control center */
.qa-q { padding: 1.1rem 1.3rem; }
.qa-body { line-height: 1.85; word-break: break-word; }
.qa-body img { max-width: 100%; border-radius: 8px; }
.qa-body pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .7rem; overflow-x: auto; }
.qa-ans { padding: 1rem 1.2rem; margin-bottom: .8rem; }
.qa-ans.qa-accepted { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.qa-ans .rc-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.closed-notice { margin: 0; padding: .9rem 1.1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-weight: 700; color: var(--muted); text-align: center; }
/* User 360 dossier */
.ud-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .4rem 0 1rem; flex-wrap: wrap; }
.ud-status { font-size: .9rem; padding: .35rem .8rem; }
.du-tag.ok { background: #dcfce7; color: #166534; }
.du-tag.warn { background: #fef9c3; color: #854d0e; }
.du-tag.danger { background: #fee2e2; color: #991b1b; }
.ud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.ud-stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; text-align: center; }
.ud-stat b { display: block; font-size: 1.15rem; }
.ud-stat span { font-size: .78rem; color: var(--muted); }
.ud-stat a { color: inherit; }
.ud-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 1.2rem; align-items: start; }
.ud-cols .card { margin-bottom: 1.2rem; }
.ud-cols h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
.ud-reason, .ud-note-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; font: inherit; resize: vertical; }
.ud-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .7rem; }
.ud-sep { color: var(--muted); font-size: .85rem; font-weight: 700; margin-inline-start: .4rem; }
.ud-lift { margin-top: .5rem; }
.ud-hint { font-size: .8rem; margin: .7rem 0 0; }
.san-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.san-row.san-active { background: #fffbea; border-radius: 8px; padding-inline: .5rem; }
.san-reason { flex: 1 1 200px; }
.san-meta { font-size: .8rem; width: 100%; }
.ud-counts { list-style: none; padding: 0; margin: 0 0 .8rem; }
.ud-counts li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.ud-device { padding: .4rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.ud-note { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-top: .6rem; }
.ud-note p { margin: 0 0 .3rem; }
.ud-note-form { display: flex; gap: .5rem; align-items: flex-start; }
.ud-note-form textarea { flex: 1; }
.ud-pw-input { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font: inherit; }
/* Admin top-bar search */
.admin-search { flex: 1; max-width: 420px; margin: 0 1rem; }
.admin-search input { width: 100%; border: 1px solid var(--line); border-radius: 20px; padding: .5rem 1rem; font: inherit; background: var(--bg); }
/* Site settings toggles */
.set-grp { margin-bottom: 1rem; }
.set-grp h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
.set-toggle { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.set-toggle input { width: 18px; height: 18px; }
.set-grp textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; font: inherit; }
/* 2FA */
.twofa-secret { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.twofa-secret code { font-size: 1.05rem; font-weight: 700; letter-spacing: 1px; }
@media (max-width: 800px) { .ud-cols { grid-template-columns: 1fr; } }
/* Suspended interstitial */
.suspended-wrap { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.suspended-card { max-width: 440px; text-align: center; padding: 2rem; }
.suspended-icon { font-size: 3rem; }
.suspended-until { font-size: 1.2rem; margin: .3rem 0 1rem; }
/* Analytics */
.an-cards .ud-stat b { font-size: 1.3rem; }
.an-chart { margin-bottom: 1.1rem; }
.an-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.an-chart-head h2 { font-size: 1.02rem; margin: 0 0 .6rem; }
.an-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: .4rem; }
.an-bar { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.an-bar-fill { width: 100%; background: var(--accent, #3b82f6); border-radius: 3px 3px 0 0; min-height: 2px; transition: opacity .15s; opacity: .85; }
.an-bar:hover .an-bar-fill { opacity: 1; }
.an-axis { display: flex; justify-content: space-between; font-size: .75rem; margin-top: .4rem; }
.an-rank { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--line); gap: 1rem; }
.an-rank a { color: inherit; }
/* Public announcement banners */
.ann-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.site-ann { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: 10px; border: 1px solid; }
.site-ann-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.site-ann-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.site-ann-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.site-ann-body b { font-weight: 800; }
.site-ann-body a { text-decoration: underline; font-weight: 700; }
.site-ann-x { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.site-ann-x:hover { opacity: 1; }
/* Announcement composer */
.ann-form { display: flex; flex-direction: column; gap: .6rem; }
.ann-form input[type=text], .ann-form input[type=url], .ann-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: .6rem; font: inherit; }
.ann-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.ann-row label { display: flex; flex-direction: column; font-size: .85rem; gap: .25rem; }
.ann-row select { border: 1px solid var(--line); border-radius: 8px; padding: .4rem; }
.ann-check { flex-direction: row !important; align-items: center; gap: .4rem !important; }
/* Taxonomy */
.tax-new { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tax-new input[type=text], .tax-new input[type=number] { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
.tax-new input[name=name] { flex: 1; min-width: 140px; }
.tax-row { border-bottom: 1px solid var(--line); }
.tax-edit summary { padding: .6rem 0; cursor: pointer; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tax-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 0; }
.tax-form input, .tax-form textarea, .tax-form select { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font: inherit; }
.tax-form textarea { width: 100%; }
.tax-merge select { min-width: 140px; }
.tax-tag { border-bottom: 1px dashed var(--line); }

/* ---- Composer: @mention typeahead + draft autosave ---- */
.mention-pop { position: absolute; z-index: 300; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 44px rgba(16,32,46,.18); overflow: hidden; max-height: 280px; overflow-y: auto; padding: .25rem; }
.mention-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .45rem .55rem; background: none; border: 0; border-radius: 8px; cursor: pointer; text-align: start; font: inherit; color: var(--ink); }
.mention-item:hover, .mention-item.active { background: var(--bg); }
.mention-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.mention-av-fb { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; }
.mention-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mention-meta b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-meta i { font-size: .76rem; color: var(--muted); font-style: normal; }
.draft-banner { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: .55rem .8rem; margin-bottom: .8rem; font-size: .88rem; }
.draft-actions { display: flex; gap: .4rem; flex: 0 0 auto; }

/* ---- Enable browser notifications (profile-completion + settings) ---- */
.comp-notif { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.comp-notif p { margin: 0 0 .45rem; font-size: .85rem; }
body.notif-granted .comp-notif { display: none; }   /* hide the whole prompt once granted */
.notif-on-note { display: none; }
body.notif-granted .notif-on-note { display: block; }

/* "Who reacted" — clickable summary + modal + follow rows */
.fp-react-summary.js-reactors { cursor: pointer; background: none; border: 0; }
.fp-react-summary.js-reactors:hover .rx-count { text-decoration: underline; }
.rx-modal { position: fixed; inset: 0; background: rgba(16,24,40,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.rx-modal[hidden] { display: none; }
.rx-modal-box { background: var(--card); border-radius: 16px; width: 100%; max-width: 420px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(16,32,46,.28); overflow: hidden; }
.rx-modal-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.rx-modal-x { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); line-height: 1; }
.rx-modal-body { overflow-y: auto; padding: .4rem; }
.reactor-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; }
.reactor-row:hover { background: var(--bg); }
.reactor-id { display: flex; align-items: center; gap: .6rem; min-width: 0; color: var(--ink); flex: 1; }
.reactor-av { position: relative; flex: 0 0 auto; }
.reactor-av img, .reactor-av .avatar-fallback { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.reactor-emoji { position: absolute; bottom: -2px; inset-inline-end: -3px; font-size: .8rem; background: var(--card); border-radius: 50%; line-height: 1; }
.reactor-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.reactor-meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reactor-meta .muted { font-size: .78rem; }
.js-follow-inline { flex: 0 0 auto; }

/* Live hashtag chips under the composer */
.hl-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .45rem 0 0; font-size: .82rem; }
.hl-chips[hidden] { display: none; }
.hl-chips-label { color: var(--muted); }
.hl-chip { color: #2563eb; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 999px; padding: .1rem .55rem; font-weight: 700; }

/* Private (draft) post badge — shown to the owner */
.fp-private { color: #b45309; background: #fef3c7; border: 1px solid #fde68a; border-radius: 999px; padding: .02rem .45rem; font-size: .72rem; font-weight: 700; }

/* Registration form clarity */
.req-star { color: #dc2626; font-weight: 700; margin-inline-start: .15rem; }
.signup-legend { font-size: .82rem; margin: 0 0 .6rem; }
.name-live-warn { color: #b91c1c; font-size: .8rem; margin-top: .3rem; font-weight: 600; }
.input-bad { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.12) !important; }
/* Live registration field status (under username + display name) */
.name-live { font-size: .8rem; margin-top: .3rem; font-weight: 600; }
.name-live-bad { color: #b91c1c; }
.name-live-ok { color: #15803d; }
.name-live-checking { color: #6b7280; font-weight: 500; }
.input-ok { border-color: #16a34a !important; box-shadow: 0 0 0 2px rgba(22,163,74,.12) !important; }

/* Story ring on the profile avatar — clickable; opens the author's story */
.profile-avatar.has-story { display: block; box-shadow: 0 0 0 3px var(--card), 0 0 0 6px #5b5bd6; cursor: pointer; transition: box-shadow .15s ease; }
.profile-avatar.has-story:hover { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px #f59e0b; }
.profile-avatar.has-story.seen { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px #c7c7cc; }

/* "OP" badge on a comment by the content owner (book uploader / post author / …) */
.c-op { display: inline-block; font-size: .7rem; font-weight: 700; color: #0f766e; background: #ccfbf1; border: 1px solid #99f6e4; border-radius: 999px; padding: .04rem .45rem; margin-inline-start: .25rem; vertical-align: middle; }

/* ===== Reel text overlays (on-video text, TikTok-style) ===== */
.reel-text-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; container-type: inline-size; overflow: hidden; }
.reel-text-ov { position: absolute; transform: translate(-50%, -50%); font-weight: 800; line-height: 1.2; text-align: center; max-width: 92%; white-space: pre-wrap; word-break: break-word; text-shadow: 0 2px 8px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.45); }

/* Reel text editor (create_reel) */
.rte { margin: .2rem 0 1rem; }
.rte-stage { position: relative; width: 100%; max-width: 320px; margin: 0 auto; aspect-ratio: 9/16; background: #000; border-radius: 16px; overflow: hidden; container-type: inline-size; touch-action: none; }
.rte-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rte-layer { position: absolute; inset: 0; }
.rte-item { position: absolute; transform: translate(-50%, -50%); font-weight: 800; line-height: 1.2; text-align: center; max-width: 92%; white-space: pre-wrap; word-break: break-word; cursor: move; touch-action: none; text-shadow: 0 2px 8px rgba(0,0,0,.55); padding: 2px 5px; }
.rte-item.sel { outline: 2px dashed rgba(255,255,255,.95); outline-offset: 2px; border-radius: 5px; }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; justify-content: center; margin-top: .75rem; }
.rte-colors { display: inline-flex; gap: .35rem; }
.rte-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cbd5e1; cursor: pointer; padding: 0; }
.rte-swatch.on { border-color: var(--teal, #1aa39a); transform: scale(1.12); box-shadow: 0 0 0 2px rgba(26,163,154,.3); }

/* ===== Image lightbox (click a photo/avatar/cover to enlarge) ===== */
html.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 24px;
  background: rgba(8,10,20,.9); cursor: zoom-out; animation: lb-fade .15s ease; }
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 96vw; max-height: 92vh; border-radius: 10px; object-fit: contain;
  box-shadow: 0 24px 70px rgba(0,0,0,.6); animation: lb-pop .18s ease; }
.lightbox-close { position: fixed; top: 14px; inset-inline-end: 16px; width: 44px; height: 44px; border: none;
  border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgba(255,255,255,.3); }
@keyframes lb-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes lb-pop { from { transform: scale(.94); opacity: .4 } to { transform: scale(1); opacity: 1 } }
img.fp-media, img.fpe-media, img.detail-media { cursor: zoom-in; }
.profile-avatar[href] { cursor: pointer; }
#profile-cover:not(.repositioning) { cursor: zoom-in; }

/* Story ring on author avatars in the feed (Instagram-style) */
.fp-avatar.has-story-ring { border-radius: 50%; box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 4px #5b5bd6; }
.fp-avatar.has-story-ring:hover { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 4px #f59e0b; }
/* seen → grey ring (Instagram-style: coloured = new, grey = already watched) */
.fp-avatar.has-story-ring.seen { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 4px #c7c7cc; }
.fp-avatar.has-story-ring.seen:hover { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 4px #a1a1aa; }

/* Ringed profile avatar → tap opens a small menu (view photo / watch story) */
.profile-avatar-wrap { position: relative; }
.profile-avatar.has-story { cursor: pointer; }
.avatar-menu { position: absolute; z-index: 60; top: 100%; inset-inline-start: 0; margin-top: 10px; min-width: 210px;
  background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 12px;
  box-shadow: 0 14px 36px rgba(16,32,46,.2); padding: 6px; }
.avatar-menu[hidden] { display: none; }
.avatar-menu button, .avatar-menu a { display: block; width: 100%; text-align: start; padding: 11px 13px; border: none;
  background: none; border-radius: 8px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.avatar-menu button:hover, .avatar-menu a:hover { background: var(--bg); text-decoration: none; }
@media (max-width: 560px) { .avatar-menu { min-width: 180px; } }

/* Profile photo post (avatar/cover change): big image + album ←→ arrows */
.photo-evt { margin: .2rem 0 1rem; }
.photo-evt .fp-evt-lbl { display: block; color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }
.photo-evt-img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #0b0b12; cursor: zoom-in; }
.photo-evt-img.is-avatar { max-width: 420px; max-height: 420px; border-radius: 14px; }
.photo-nav { display: flex; justify-content: space-between; gap: .6rem; margin-top: .9rem; }
.photo-nav-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .95rem; border-radius: 999px; background: var(--bg); color: var(--navy); font-weight: 600; border: 1px solid var(--line); }
.photo-nav-btn:hover { background: var(--teal-50, #e6fffb); text-decoration: none; }
@media (max-width: 560px) { .photo-evt-img.is-avatar { max-width: 100%; } .photo-nav-btn { font-size: .85rem; padding: .45rem .7rem; } }

/* "View cover photo" pill — top-end corner, clear of the edit/reposition controls */
.cover-view-btn { position: absolute; top: 14px; inset-inline-end: 18px; z-index: 3; display: inline-flex;
  align-items: center; gap: .3rem; background: rgba(0,0,0,.55); color: #fff; padding: .42rem .9rem;
  border-radius: 999px; font-size: .82rem; font-weight: 700; backdrop-filter: blur(4px); }
.cover-view-btn:hover { background: rgba(0,0,0,.78); text-decoration: none; }
@media (max-width: 560px) { .cover-view-btn { font-size: .72rem; padding: .32rem .65rem; top: 10px; } }
