/* Nihehe shared components. Everything is prefixed nh- so it cannot clash with old page styles. */
@keyframes nh-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes nh-shimmer { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }
.nh-rise { animation: nh-rise .4s var(--ease) both; }

/* ---------- Buttons and pills ---------- */
.nh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 24px;
  border-radius: var(--radius-pill); border: 1px solid transparent; font: 800 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s var(--ease); }
.nh-btn:active { transform: scale(.98); }
.nh-btn--primary { background: var(--brand); color: #fff; }
.nh-btn--primary:hover { background: var(--brand-dark); }
.nh-btn--accent { background: var(--accent); color: var(--brand); }
.nh-btn--ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.nh-btn[disabled], .nh-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.nh-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--brand-light); color: var(--brand); font: 600 13px/1 var(--font); white-space: nowrap; }

/* ---------- Cards, skeleton, toast, sheet ---------- */
.nh-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.nh-sk { background: linear-gradient(90deg, #e6edf4 0, #f4f7fa 150px, #e6edf4 300px); background-size: 600px 100%; animation: nh-shimmer 1.4s linear infinite; border-radius: var(--radius-pill); }
.nh-toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 1300; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill); background: var(--brand); color: #fff; font: 800 15px/1 var(--font); box-shadow: var(--shadow-card); animation: nh-rise .3s var(--ease) both; }
.nh-sheet-backdrop { position: fixed; inset: 0; z-index: 1250; background: rgba(19, 45, 76, .55); }
.nh-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1260; background: var(--surface); border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 12px 24px calc(32px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-sheet); animation: nh-rise .3s var(--ease) both; font-family: var(--font); color: var(--ink); }
@media (min-width: 761px) { .nh-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; transform: translate(-50%, -50%); border-radius: var(--radius-card); } }

/* ---------- Header ---------- */
.nh-header { position: sticky; top: 0; z-index: 1100; background: var(--brand); color: #fff; font-family: var(--font); padding-top: env(safe-area-inset-top); }
.nh-header *, .nh-footer * { box-sizing: border-box; }
.nh-header-inner { position: relative; max-width: 1100px; margin: 0 auto; padding: 0 20px; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nh-logo { display: inline-flex; align-items: center; min-height: 44px; }
.nh-logo img { display: block; height: 40px; width: auto; }
.nh-nav { display: flex; align-items: center; gap: 4px; }
.nh-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); color: #fff; font: 600 15px/1 var(--font); text-decoration: none; transition: background-color .15s var(--ease); }
.nh-link:hover { background: rgba(255, 255, 255, .12); }
.nh-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-pill); border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; cursor: pointer; }
.nh-account { position: relative; margin-left: 8px; }
.nh-account-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--brand); font: 800 15px/1 var(--font); cursor: pointer; transition: transform .15s var(--ease); }
.nh-account-trigger:active { transform: scale(.98); }
.nh-chev, .account-menu-chevron { display: none; }
.nh-account.open .nh-chev, .nh-account.open .account-menu-chevron { transform: rotate(180deg); }
.nh-account-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 1100; min-width: 248px; padding: 8px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 40px rgba(19, 45, 76, .2); }
.nh-account.open .nh-account-dropdown { display: block; animation: nh-rise .25s var(--ease) both; }
.nh-account-user { padding: 12px 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nh-account-name { font: 800 15px/1.3 var(--font); }
.nh-account-username { font: 600 13px/1.3 var(--font); color: var(--muted); }
.nh-account-dropdown a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 16px; color: var(--ink); font: 600 15px/1 var(--font); text-decoration: none; }
.nh-account-dropdown a:hover { background: var(--brand-light); }
.nh-signout { display: flex; align-items: center; width: 100%; min-height: 44px; margin-top: 4px; padding: 0 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; background: transparent; color: var(--danger); font: 800 15px/1 var(--font); text-align: left; cursor: pointer; }
.nh-signout:hover { background: #fdecea; }
.nh-header :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nh-account-dropdown :focus-visible, .nh-nav.open :focus-visible { outline-color: var(--brand); }

@media (max-width: 760px) {
  .nh-toggle { display: inline-flex; }
  .nh-nav { display: none; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); z-index: 1100; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 40px rgba(19, 45, 76, .2); }
  .nh-nav.open { display: flex; animation: nh-rise .25s var(--ease) both; }
  .nh-nav .nh-link { color: var(--ink); }
  .nh-nav .nh-link:hover { background: var(--brand-light); }
  .nh-account { margin: 4px 0 0; }
  .nh-account-trigger { width: 100%; justify-content: center; }
  .nh-account-dropdown { position: static; min-width: 0; margin-top: 8px; box-shadow: none; border-radius: 20px; }
}

/* ---------- Footer ---------- */
.nh-footer { background: var(--brand); color: #c9d6e6; font-family: var(--font); border-radius: 32px 32px 0 0; margin-top: 48px; padding-bottom: env(safe-area-inset-bottom); }
.nh-footer-inner { max-width: 1100px; margin: 0 auto; padding: 32px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; }
.nh-footer img { display: block; height: 36px; width: auto; }
.nh-footer-links { display: flex; flex-wrap: wrap; gap: 4px; }
.nh-footer a { color: #c9d6e6; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-pill); }
.nh-footer a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.nh-footer :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.nh-footer-note { width: 100%; font-size: 13px; color: #9fb2c8; }

@media (prefers-reduced-motion: reduce) {
  .nh-rise, .nh-sk, .nh-toast, .nh-sheet, .nh-nav.open, .nh-account.open .nh-account-dropdown { animation: none; }
  .nh-btn, .nh-link, .nh-account-trigger, .nh-chev, .account-menu-chevron { transition: none; }
}

/* NH:FOOTER-EXTRA:START */
.nh-footer-copy { width: 100%; font-size: 12px; color: #7f94ad; }
body:has(.whatsapp-float) .nh-footer, body:has(.sp-fab) .nh-footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
/* NH:FOOTER-EXTRA:END */

/* NH:MOBILE-MENU:START */
.nh-account-user { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nh-account-close { display: none; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-pill); background: var(--page); color: var(--ink); cursor: pointer; }
@media (min-width: 761px) {
  .nh-nav { margin-left: auto; }
  .nh-account { margin-left: 0; }
}
@media (max-width: 760px) {
  .nh-logo { margin-right: auto; }
  .nh-nav { max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .nh-account { position: static; order: 0; margin: 0; padding: 0; border: 0; }
  .nh-account-trigger { width: auto; min-height: 44px; padding: 0 16px; font-size: 14px; position: relative; z-index: 1060; }
  .nh-account-trigger .nh-chev { display: none; }
  .nh-account.open::before { content: ""; position: fixed; inset: 0; z-index: 1050; background: rgba(19, 45, 76, .45); animation: nh-fade .2s ease both; }
  .nh-account-dropdown { display: none; position: absolute; left: auto; right: 12px; top: calc(100% + 8px); z-index: 1100; width: min(320px, calc(100vw - 24px)); min-width: 0; margin: 0; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 40px rgba(19, 45, 76, .25);
    max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }
  .nh-account.open .nh-account-dropdown { display: flex; flex-direction: column; gap: 2px; animation: nh-rise .25s var(--ease) both; }
  .nh-account-close { display: inline-flex; }
  .nh-account-dropdown .nh-account-user { padding: 8px 8px 12px 16px; margin-bottom: 4px; }
  .nh-account-dropdown a { min-height: 50px; padding: 0 16px; font-size: 16px; background: transparent; }
  .nh-account-dropdown a::after { content: "\203A"; margin-left: auto; color: var(--muted); font-size: 22px; font-weight: 400; }
  .nh-account-dropdown .nh-signout { justify-content: flex-start; min-height: 50px; margin-top: 6px; border: 0; border-top: 1px solid var(--line); border-radius: 16px; background: transparent; font-size: 16px; }
}
@keyframes nh-fade { from { opacity: 0; } to { opacity: 1; } }
/* NH:MOBILE-MENU:END */

/* NH:SIGNUP:START */
.nh-signup { display: none; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill); background: var(--accent); color: var(--brand);
  font: 800 15px/1 var(--font); text-decoration: none; white-space: nowrap; transition: transform .15s var(--ease), background-color .2s var(--ease); }
.nh-signup:hover { background: #1bbdf3; }
.nh-signup:active { transform: scale(.98); }
.nh-out .nh-signup { display: inline-flex; }
.nh-out .nh-account-trigger { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.nh-out .nh-account-trigger:hover { background: rgba(255, 255, 255, .12); }
.nh-out .nh-account-trigger .nh-chev { display: none; }
@media (min-width: 761px) { .nh-out .nh-account { margin-right: 0; } }
@media (max-width: 760px) {
  .nh-out .nh-header-inner { gap: 8px; }
  .nh-out .nh-account-trigger, .nh-signup { padding: 0 14px; font-size: 14px; }
}
@media (max-width: 380px) {
  .nh-out .nh-header-inner { padding: 0 12px; gap: 6px; }
  .nh-out .nh-logo img { height: 32px; }
  .nh-out .nh-account-trigger, .nh-signup { padding: 0 11px; font-size: 13px; }
  .nh-out .nh-toggle { width: 40px; height: 40px; }
}
/* NH:SIGNUP:END */

/* NH:NAV-MOTION:START */
@keyframes nh-nav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes nh-pop { 0% { opacity: 0; transform: scale(.5); } 70% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes nh-item-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* the header settles in, one item after another */
.nh-logo, .nh-nav .nh-link, .nh-account, .nh-signup, .nh-toggle { animation: nh-nav-in .45s var(--ease) both; }
.nh-logo { animation-delay: .02s; }
.nh-nav .nh-link:nth-child(1) { animation-delay: .06s; }
.nh-nav .nh-link:nth-child(2) { animation-delay: .1s; }
.nh-nav .nh-link:nth-child(3) { animation-delay: .14s; }
.nh-nav .nh-link:nth-child(4) { animation-delay: .18s; }
.nh-account { animation-delay: .22s; }
.nh-signup { animation-delay: .26s; }
.nh-toggle { animation-delay: .22s; }
.nh-account-trigger, .nh-signup { transition: transform .15s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.nh-account-trigger:hover, .nh-signup:hover { transform: translateY(-1px); }
.nh-account-trigger:active, .nh-signup:active { transform: scale(.97); }

/* sliding underline on desktop; the current page keeps it */
@media (min-width: 761px) {
  .nh-nav .nh-link { position: relative; }
  .nh-nav .nh-link::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 9px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform .28s var(--ease); }
  .nh-nav .nh-link:hover::after, .nh-nav .nh-link.is-current::after { transform: scaleX(1); }
}
@media (max-width: 760px) { .nh-nav .nh-link.is-current { background: var(--brand-light); font-weight: 800; } }

/* menu items glide in when a menu opens */
.nh-account.open .nh-account-dropdown > a, .nh-account.open .nh-account-dropdown > .nh-signout { animation: nh-item-in .3s var(--ease) both; }
.nh-account.open .nh-account-dropdown > :nth-child(2) { animation-delay: .03s; }
.nh-account.open .nh-account-dropdown > :nth-child(3) { animation-delay: .06s; }
.nh-account.open .nh-account-dropdown > :nth-child(4) { animation-delay: .09s; }
.nh-account.open .nh-account-dropdown > :nth-child(5) { animation-delay: .12s; }
.nh-account.open .nh-account-dropdown > :nth-child(6) { animation-delay: .15s; }
.nh-account.open .nh-account-dropdown > :nth-child(7) { animation-delay: .18s; }
.nh-account.open .nh-account-dropdown > :nth-child(8) { animation-delay: .21s; }
.nh-account.open .nh-account-dropdown > :nth-child(9) { animation-delay: .24s; }
.nh-account.open .nh-account-dropdown > :nth-child(10) { animation-delay: .27s; }
.nh-account.open .nh-account-dropdown > :nth-child(11) { animation-delay: .3s; }
@media (max-width: 760px) {
  .nh-nav.open .nh-link { animation: nh-item-in .3s var(--ease) both; }
  .nh-nav.open .nh-link:nth-child(2) { animation-delay: .04s; }
  .nh-nav.open .nh-link:nth-child(3) { animation-delay: .08s; }
  .nh-nav.open .nh-link:nth-child(4) { animation-delay: .12s; }
}

/* the account button as a profile photo */
.nh-header .nh-account.has-avatar .nh-account-trigger { width: 48px; height: 48px; min-height: 48px; padding: 0; gap: 0; border-radius: 50%; font-size: 0; line-height: 0; overflow: hidden; background: var(--accent); color: var(--brand); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); justify-content: center; }
.nh-header .nh-account.has-avatar .nh-account-trigger:hover { box-shadow: 0 0 0 3px #fff; transform: scale(1.06); }
.nh-header .nh-account.has-avatar .nh-account-trigger:active { transform: scale(.95); }
.nh-header .nh-account.has-avatar .nh-account-trigger:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.nh-header .nh-account.has-avatar .nh-chev { display: none; }
.nh-avatar { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; font: 800 19px/1 var(--font); color: var(--brand); animation: nh-pop .5s var(--ease) both; }
.nh-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .nh-header .nh-account.has-avatar .nh-account-trigger { width: 44px; height: 44px; min-height: 44px; padding: 0; } }
@media (prefers-reduced-motion: reduce) {
  .nh-logo, .nh-nav .nh-link, .nh-account, .nh-signup, .nh-toggle, .nh-avatar, .nh-nav.open .nh-link,
  .nh-account.open .nh-account-dropdown > a, .nh-account.open .nh-account-dropdown > .nh-signout { animation: none; }
  .nh-nav .nh-link::after, .nh-account-trigger, .nh-signup { transition: none; }
}
/* NH:NAV-MOTION:END */
