/* =========================================================
   ArticlePaid Header V10 — fully namespaced (.ap10-*)
   No Tailwind, no resets, no global selectors. Drop-in safe.
   ========================================================= */
:root {
  --ap10-ink: #0f172a;
  --ap10-paper: #ffffff;
  --ap10-cream: #fafaf7;
  --ap10-line: #e8e4d9;
  --ap10-line-2: #f0ece1;
  --ap10-muted: #6b6b6b;
  --ap10-muted-soft: #94a3b8;
  --ap10-accent: #ff5a1f;
  --ap10-accent-soft: #ffe8dc;
  --ap10-green: #1A8917;
  --ap10-shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --ap10-shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --ap10-shadow-lg: 0 20px 50px rgba(15,23,42,.12);
  --ap10-radius: 14px;
  --ap10-h: 64px;
  --ap10-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ap10-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Reset only inside our header tree ===== */
.ap10-header, .ap10-header *,
.ap10-mdock, .ap10-mdock *,
.ap10-search-overlay, .ap10-search-overlay * {
  box-sizing: border-box;
}

/* Spacer so page content isn't hidden behind fixed header */
.ap10-spacer { height: var(--ap10-h); }

/* ============== HEADER ============== */
.ap10-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--ap10-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ap10-line);
  z-index: 1000;
  font-family: var(--ap10-sans);
  color: var(--ap10-ink);
  transition: transform .3s ease, box-shadow .3s ease;
}
.ap10-header.is-scrolled { box-shadow: var(--ap10-shadow-sm); }

.ap10-header__inner {
  max-width: 1280px; height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* ----- Logo ----- */
.ap10-logo {
  display: inline-flex; align-items: center;
  text-decoration: none;
  font-family: var(--ap10-serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ap10-ink);
  white-space: nowrap;
}
.ap10-logo span {
  color: var(--ap10-accent);
  font-weight: 600;
}
.ap10-logo:hover { opacity: .85; }

/* ----- Nav ----- */
.ap10-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}
.ap10-nav__item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
.ap10-nav__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.ap10-nav__item:hover { background: var(--ap10-cream); color: var(--ap10-ink); }
.ap10-nav__item.is-active {
  background: var(--ap10-ink);
  color: #fff;
  font-weight: 600;
}
.ap10-nav__item.is-active svg { stroke-width: 2; }

/* ----- Right cluster ----- */
.ap10-actions {
  display: flex; align-items: center; gap: 6px;
  justify-self: end;
}
.ap10-iconbtn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; outline: none;
  background: transparent;
  border-radius: 50%;
  color: var(--ap10-ink);
  cursor: pointer;
  position: relative;
  transition: background .2s ease;
}
.ap10-iconbtn:hover { background: var(--ap10-cream); }
.ap10-iconbtn svg { width: 22px; height: 22px; }
.ap10-iconbtn:focus-visible { outline: 2px solid var(--ap10-accent); outline-offset: 2px; }

/* =========================================================
   NOTIFICATIONS — bell + anchored dropdown panel
   ========================================================= */
.ap10-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ap10-notif__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a1f;
  border: 2px solid #fff;
  box-sizing: content-box;
  display: none;
  pointer-events: none;
}
.ap10-notif__dot.is-on,
.ap10-notif__dot.active {
  display: block;
  animation: ap10-notif-pulse 2s infinite;
}
@keyframes ap10-notif-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(255, 90, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}

.ap10-notif__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px -10px rgba(15, 23, 42, 0.18);
  padding: 0;
  overflow: hidden;
  transform-origin: top right;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition:
    opacity .22s cubic-bezier(.16, 1, .3, 1),
    transform .22s cubic-bezier(.175, .885, .32, 1.1),
    visibility .22s;
}
.ap10-notif.is-open .ap10-notif__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ap10-notif__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(255,250,247,0.6) 0%, transparent 100%);
}
.ap10-notif__head h4 {
  margin: 0;
  font-family: var(--ap10-serif, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
}
.ap10-notif__clear {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff5a1f;
  background: transparent;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
}
.ap10-notif__clear:hover {
  background: #ffe8dc;
  border-color: rgba(255, 90, 31, 0.2);
}

.ap10-notif__body {
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15,23,42,0.15) transparent;
}
.ap10-notif__body::-webkit-scrollbar { width: 6px; }
.ap10-notif__body::-webkit-scrollbar-track { background: transparent; }
.ap10-notif__body::-webkit-scrollbar-thumb {
  background: rgba(15,23,42,0.12);
  border-radius: 6px;
}
.ap10-notif__body::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.25); }

.ap10-notif__empty {
  padding: 56px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
}
.ap10-notif__empty::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid rgba(15,23,42,0.06);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff5a1f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9'/><path d='M13.73 21a2 2 0 0 1-3.46 0'/></svg>"),
    linear-gradient(135deg, #fafaf7 0%, #f5f1e8 100%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px, cover;
}

.ap10-notif__panel .notif-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: #0f172a;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  transition: background .15s ease;
  position: relative;
  align-items: flex-start;
}
.ap10-notif__panel .notif-item:last-child { border-bottom: none; }
.ap10-notif__panel .notif-item:hover { background: rgba(255, 90, 31, 0.04); }

.ap10-notif__panel .notif-item.unread::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5a1f;
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.18);
}

.ap10-notif__panel .notif-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}

.ap10-notif__panel .notif-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: #0f172a;
  font-weight: 500;
}
.ap10-notif__panel .notif-text strong {
  font-weight: 700;
  color: #0f172a;
}
.ap10-notif__panel .notif-text a {
  color: #ff5a1f;
  text-decoration: none;
  font-weight: 600;
}
.ap10-notif__panel .notif-text a:hover { text-decoration: underline; }

.ap10-notif__panel .notif-time {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Colored tag pills */
.ap10-notif__panel .n-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px 3px 5px;
  border-radius: 5px;
  margin-right: 6px;
  margin-bottom: 2px;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1;
}
.ap10-notif__panel .n-tag svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.ap10-notif__panel .n-chat      { background: #e0e7ff; color: #4338ca; }
.ap10-notif__panel .n-follow    { background: #dcfce7; color: #15803d; }
.ap10-notif__panel .n-vote-up   { background: #dbeafe; color: #1d4ed8; }
.ap10-notif__panel .n-vote-down { background: #fee2e2; color: #b91c1c; }
.ap10-notif__panel .n-cmt       { background: #f3e8ff; color: #7e22ce; }
.ap10-notif__panel .n-new       { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.ap10-notif__panel .n-book      { background: #fef3c7; color: #b45309; }

.ap10-notif__panel .notif-footer {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff5a1f;
  text-decoration: none;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 250, 247, 0.4);
  transition: background .15s ease;
}
.ap10-notif__panel .notif-footer:hover { background: #ffe8dc; }

/* User avatar */
.ap10-avatar-link {
  width: 36px; height: 36px; display: block;
  border-radius: 50%; overflow: hidden;
  border: 1.5px solid var(--ap10-line);
  transition: border-color .2s, transform .2s;
}
.ap10-avatar-link:hover { border-color: var(--ap10-ink); transform: scale(1.05); }
.ap10-avatar-link img,
.ap10-avatar-initials {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.ap10-avatar-initials {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--ap10-accent), #ffb84d);
  color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em;
}

/* CTA login button */
.ap10-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  background: var(--ap10-ink);
  color: #fff;
  border: 1.5px solid var(--ap10-ink);
  transition: all .2s ease;
  white-space: nowrap;
}
.ap10-cta:hover { background: var(--ap10-accent); border-color: var(--ap10-accent); }
.ap10-cta svg { width: 16px; height: 16px; }

/* =========== INLINE / OVERLAY SEARCH =========== */
.ap10-search-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--ap10-h) + 24px);
}
.ap10-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.ap10-search-overlay__shell {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--ap10-shadow-lg);
  overflow: hidden;
  margin: 0 16px;
  transform: translateY(-12px);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--ap10-h) - 48px);
}
.ap10-search-overlay.is-open .ap10-search-overlay__shell { transform: translateY(0); }

.ap10-search-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--ap10-line);
}
.ap10-search-bar svg { width: 22px; height: 22px; color: var(--ap10-muted); flex-shrink: 0; }
.ap10-search-bar input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font: 400 1.125rem/1.4 var(--ap10-sans);
  color: var(--ap10-ink);
  padding: 4px 0;
}
.ap10-search-bar input::placeholder { color: var(--ap10-muted-soft); }
.ap10-search-bar kbd {
  font-family: var(--ap10-sans);
  font-size: 11px; font-weight: 600;
  background: var(--ap10-cream);
  border: 1px solid var(--ap10-line);
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--ap10-muted);
}
.ap10-search-bar__close {
  display: none;
  border: none; background: transparent; cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: var(--ap10-muted);
}
.ap10-search-bar__close:hover { background: var(--ap10-cream); color: var(--ap10-ink); }

.ap10-search-tabs {
  display: flex; gap: 4px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--ap10-line-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.ap10-search-tabs::-webkit-scrollbar { display: none; }
.ap10-search-tab {
  padding: 8px 14px;
  font: 600 13px/1 var(--ap10-sans);
  color: var(--ap10-muted);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.ap10-search-tab:hover { background: var(--ap10-cream); color: var(--ap10-ink); }
.ap10-search-tab.is-active { background: var(--ap10-ink); color: #fff; }
.ap10-search-tab__count {
  display: inline-block;
  background: rgba(255,255,255,.2);
  color: inherit;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.ap10-search-tab:not(.is-active) .ap10-search-tab__count {
  background: var(--ap10-line);
  color: var(--ap10-muted);
}
.ap10-search-tab__count:empty { display: none; }

.ap10-search-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.ap10-search-empty {
  padding: 56px 24px;
  text-align: center;
}
.ap10-search-empty h3 {
  margin: 0 0 8px;
  font-family: var(--ap10-serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ap10-ink);
}
.ap10-search-empty p { margin: 0; color: var(--ap10-muted); font-size: 14px; }

.ap10-result-group__title {
  margin: 12px 0 6px;
  padding: 0 22px;
  font: 700 11px/1 var(--ap10-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ap10-muted-soft);
}

.ap10-result-card {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 14px;
  align-items: center;
  padding: 14px 22px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  border-bottom: 1px solid var(--ap10-line-2);
}
.ap10-result-card:hover { background: var(--ap10-cream); }
.ap10-result-card:last-child { border-bottom: none; }
.ap10-result-card__type {
  display: inline-block;
  font: 700 10px/1 var(--ap10-sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ap10-accent);
  margin-bottom: 6px;
}
.ap10-result-card h4 {
  margin: 0;
  font-family: var(--ap10-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ap10-ink);
}
.ap10-result-card__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ap10-muted);
}
.ap10-result-card__thumb {
  width: 80px; height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ap10-cream), var(--ap10-accent-soft));
  flex-shrink: 0;
}
.ap10-result-card__thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.ap10-result-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.ap10-result-user:hover { background: var(--ap10-cream); }
.ap10-result-user__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ap10-accent), #ffb84d);
}
.ap10-result-user__name {
  margin: 0;
  font-family: var(--ap10-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ap10-ink);
  letter-spacing: -0.01em;
}
.ap10-result-user__handle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ap10-muted);
}

/* Skeleton */
.ap10-skeleton {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--ap10-line-2);
}
.ap10-skeleton__line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ap10-line-2) 25%, var(--ap10-cream) 50%, var(--ap10-line-2) 75%);
  background-size: 200% 100%;
  animation: ap10-pulse 1.2s ease-in-out infinite;
}
.ap10-skeleton__thumb {
  width: 80px; height: 64px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--ap10-line-2) 25%, var(--ap10-cream) 50%, var(--ap10-line-2) 75%);
  background-size: 200% 100%;
  animation: ap10-pulse 1.2s ease-in-out infinite;
}
@keyframes ap10-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========= MOBILE DOCK ========= */
.ap10-mdock {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--ap10-line);
  z-index: 998;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
  font-family: var(--ap10-sans);
}
.ap10-mdock__link {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 6px;
  text-decoration: none;
  color: var(--ap10-muted);
  font-size: 10px;
  font-weight: 500;
  border-radius: 8px;
  transition: color .15s;
}
.ap10-mdock__link svg { width: 22px; height: 22px; }
.ap10-mdock__link.is-active { color: var(--ap10-ink); font-weight: 700; }
.ap10-mdock__link.is-active svg { stroke-width: 2.2; }
.ap10-mdock__link.is-search-trigger { cursor: pointer; }

/* ========= RESPONSIVE ========= */
@media (max-width: 980px) {
  .ap10-nav { display: none; }
  .ap10-header__inner { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 720px) {
  .ap10-mdock { display: flex; }
  .ap10-search-overlay__shell { margin: 0; border-radius: 0; max-height: calc(100vh - var(--ap10-h)); }
  .ap10-search-overlay { padding-top: var(--ap10-h); align-items: stretch; }
  .ap10-search-bar__close { display: inline-flex; }
  .ap10-search-bar kbd { display: none; }
  body { padding-bottom: 60px; }
}
@media (max-width: 480px) {
  .ap10-header__inner { padding: 0 14px; gap: 12px; }
  .ap10-cta span { display: none; }
  .ap10-cta { padding: 9px 12px; }

  .ap10-notif__panel {
    position: fixed;
    top: calc(var(--ap10-h) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    border-radius: 16px;
  }
  .ap10-notif__panel .notif-item { padding: 12px 14px; }
  .ap10-notif__head { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ap10-header, .ap10-search-overlay, .ap10-search-overlay__shell,
  .ap10-skeleton__line, .ap10-skeleton__thumb,
  .ap10-iconbtn, .ap10-avatar-link, .ap10-result-card, .ap10-result-user,
  .ap10-notif__panel, .ap10-notif__dot {
    transition: none !important;
    animation: none !important;
  }
}