/* ==========================================================================
   Heartnest – shared parts every area needs that the design pages did not draw
   (demo ribbon, flash messages, toast, cookie notice, install prompt, incoming
   call ring, email-confirm bar, language menu, placeholder page, form errors).
   Tokens only (base.css --hn-*): presets, custom colours and dark mode follow.
   No glass: solid panels with real shadows.
   ========================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

[hidden] { display: none !important; }
.noanim *, .noanim *::before, .noanim *::after { animation: none !important; transition: none !important; }
.logo-img { height: 38px; width: auto; }
.dark-only { display: none; }
:root[data-theme="dark"] .logo-img.light-only:has(+ .dark-only) { display: none; }
:root[data-theme="dark"] .dark-only { display: block; }
.me-ini { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--hn-tint); color: var(--hn-tint-ink); font-weight: 800; font-size: 14px; }
.ad-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ad-av.ini, span.ad-av { display: inline-grid; place-items: center; background: var(--hn-tint); color: var(--hn-tint-ink); font-weight: 800; font-size: 13px; }
.ad-side-foot form { margin: 0; }
.ad-side-foot form button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: var(--hn-ink-2); text-align: left; }
.ad-side-foot form button:hover { background: var(--hn-surface-2); color: var(--hn-ink); }
.ad-side-foot form button .ico { width: 19px; height: 19px; }
.ad-top .ad-acts { margin-left: auto; }
/* next to the search the actions follow it; on phones (search hidden) they stay at the right edge */
@media (min-width: 981px) { .ad-top .ad-search + .ad-acts { margin-left: 0; } }

/* demo ribbon */
.hn-demo { position: relative; z-index: 60; padding: 6px 16px; text-align: center; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; background: var(--hn-ink); color: var(--hn-bg); }

/* flash messages */
.hn-flashes { display: grid; gap: 10px; padding-top: 16px; }
.hn-flashes-app { padding: 16px 24px 0; max-width: 1240px; margin: 0 auto; }
.hn-flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 600; border: 1px solid var(--hn-line); background: var(--hn-surface); color: var(--hn-ink); box-shadow: var(--hn-shadow-sm); }
.hn-flash .ico { width: 18px; height: 18px; margin-top: 2px; }
.hn-flash.ok .ico { color: var(--hn-green-ink); }
.hn-flash.bad { border-color: var(--hn-danger); }
.hn-flash.bad .ico { color: var(--hn-danger); }
.hn-flash.info .ico { color: var(--hn-link); }
.hn-field-err { display: block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--hn-danger); }
.inp.is-bad, .sel.is-bad, .txa.is-bad { border-color: var(--hn-danger); }

/* email confirmation bar (member area) */
.hn-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 10px 16px; background: var(--hn-gold-soft); color: var(--hn-gold-ink); font-size: 14px; font-weight: 700; }
.hn-confirm .ico { width: 18px; height: 18px; }
.hn-confirm form { margin: 0; }
.hn-confirm button { min-height: 36px; padding: 0 12px; border-radius: 999px; font-weight: 800; text-decoration: underline; color: inherit; }

/* toast (same look as the design's .mb-toast) */
.hn-toast { position: fixed; z-index: 130; left: 16px; right: 16px; bottom: 28px; margin: 0 auto; width: fit-content; max-width: min(520px, calc(100% - 32px)); transform: translateY(20px); display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 16px; background: var(--hn-ink); color: var(--hn-bg); font-weight: 600; font-size: 14.5px; line-height: 1.4; text-align: left; box-shadow: var(--hn-shadow-lg); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s, transform .3s, visibility .3s; }
.hn-toast.show { opacity: 1; visibility: visible; transform: translateY(0); }
.hn-toast .ico { width: 20px; height: 20px; color: var(--hn-pink); flex: none; }

.hn-toast.bad .ico { color: var(--hn-danger); }
@media (max-width: 980px) { .app-page .hn-toast { bottom: 88px; } .hn-toast { width: auto; } }
body.c-thread-page .hn-toast { bottom: 96px; }
@media (max-width: 980px) { body.c-thread-page .hn-toast { bottom: 176px; } }

/* cookie notice */
.hn-cookie { position: fixed; z-index: 95; left: 16px; bottom: 16px; width: min(380px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--hn-surface); border: 1px solid var(--hn-line); box-shadow: var(--hn-shadow-lg); }
.hn-cookie p { flex: 1; min-width: 0; font-size: 13.5px; color: var(--hn-ink-2); line-height: 1.45; }
.hn-cookie .btn { flex: none; }
@media (max-width: 980px) { .app-page .hn-cookie { bottom: 84px; } }

/* install prompt */
.hn-install { position: fixed; z-index: 96; right: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 20px; background: var(--hn-surface); border: 1px solid var(--hn-line); box-shadow: var(--hn-shadow-lg); }
.hn-install-ic img { width: 40px; height: 40px; border-radius: 12px; }
.hn-install-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hn-install-tx b { font-size: 14.5px; }
.hn-install-tx small { font-size: 12.5px; color: var(--hn-ink-3); line-height: 1.35; }
.hn-install .btn { flex: none; }
.hn-install .icon-btn { width: 36px; height: 36px; flex: none; }
.hn-install.ios .btn { display: none; }
@media (max-width: 980px) { .app-page .hn-install { bottom: 84px; } }

/* incoming call ring */
.hn-ring { position: fixed; z-index: 140; left: 50%; top: 84px; transform: translateX(-50%); width: min(460px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; background: var(--hn-ink); color: var(--hn-bg); box-shadow: var(--hn-shadow-lg); }
:root[data-theme="dark"] .hn-ring { background: var(--hn-surface-2); color: var(--hn-ink); border: 1px solid var(--hn-line-2); }
.hn-ring-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--hn-pink); flex: none; animation: hnRing 1.4s ease-in-out infinite; }
.hn-ring-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hn-ring-tx b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hn-ring-tx small { font-size: 13px; opacity: .85; }
.hn-ring-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.hn-ring-btn .ico { width: 22px; height: 22px; }
.hn-ring-btn.no { background: var(--hn-danger); }
.hn-ring-btn.yes { background: var(--hn-green-ink); }
@keyframes hnRing { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--hn-shadow-c), .45); } 50% { box-shadow: 0 0 0 10px rgba(var(--hn-shadow-c), 0); } }
@media (max-width: 980px) { .hn-ring { top: 68px; } }

/* language menu */
.hn-lang { position: relative; }
.hn-lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hn-line); background: var(--hn-surface); font-size: 13.5px; font-weight: 700; color: var(--hn-ink-2); }
.hn-lang summary::-webkit-details-marker { display: none; }
.hn-lang summary .ico { width: 16px; height: 16px; }
.hn-lang .flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; }
.hn-lang-menu { position: absolute; z-index: 70; right: 0; bottom: calc(100% + 8px); min-width: 200px; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--hn-surface); border: 1px solid var(--hn-line); box-shadow: var(--hn-shadow-lg); display: grid; gap: 2px; }
.hn-lang-header .hn-lang-menu, .hn-lang-drawer .hn-lang-menu { bottom: auto; top: calc(100% + 8px); }
.hn-lang-menu a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--hn-ink); }
.hn-lang-menu a:hover, .hn-lang-menu a[aria-current] { background: var(--hn-tint); color: var(--hn-tint-ink); }
.hn-lang-header summary span { display: none; }
@media (max-width: 980px) { .head-acts .hn-lang-header { display: none; } }

/* placeholder page (removed when the builder delivers the page) */
.hn-placeholder { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 72px 16px; }
.hn-ph-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--hn-tint); color: var(--hn-tint-ink); }
.hn-ph-ic .ico { width: 30px; height: 30px; }
.hn-placeholder h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.hn-placeholder p { color: var(--hn-ink-2); }
.hn-ph-meta { font-size: 13px; color: var(--hn-ink-3) !important; }

/* blurred "likes you" tiles: the image is already a tiny blurred file (never the real photo) */
.hn-blur { filter: blur(14px) saturate(1.1); transform: scale(1.15); }

.set-wrap dialog.dlg, dialog.dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; border: 1px solid var(--hn-line); border-radius: 20px; padding: 20px; background: var(--hn-surface); color: var(--hn-ink); box-shadow: var(--hn-shadow-lg); }
dialog.dlg::backdrop { background: var(--hn-scrim); }

/* Admin › Payments orders: fits the box on desktop (1280–1920) – gateway + its ID share a cell, item and date may wrap;
   phones keep the sideways scroll inside the table box */
.tbl-pay .pay-gw small { display: block; font-size: 12px; margin-top: 2px; }
@media (min-width: 981px) {
  .tbl-pay th, .tbl-pay td { padding-left: 9px; padding-right: 9px; }
  .tbl-pay th:first-child, .tbl-pay td:first-child { padding-left: 18px; }
  .tbl-pay th:last-child, .tbl-pay td:last-child { padding-right: 18px; }
  .tbl-pay th { white-space: normal; }
  .tbl-pay .pay-item { white-space: normal; min-width: 96px; }
  .tbl-pay .pay-date { white-space: normal; min-width: 64px; }
  .tbl-pay .who span b { white-space: normal; }
}
/* admin editor tables (plan limits, coin packs) fit the box on laptops too */
@media (min-width: 981px) and (max-width: 1439px) { .tbl .inp-g { width: 112px; } .tbl td:has(.inp-g), .tbl th { padding-left: 9px; padding-right: 9px; } }
@media (min-width: 981px) and (max-width: 1439px) { .tbl.lim-tbl .inp-g { width: 86px; } .tbl.lim-tbl .inp-g em { padding: 0 6px; } .tbl.lim-tbl td, .tbl.lim-tbl th { padding-left: 6px; padding-right: 6px; } }

/* Verified badge: a seal with a bold white tick, readable at list sizes */
.badge-verified { border-radius: 0; background: var(--hn-sky); -webkit-mask: url(../img/seal.svg) center / contain no-repeat; mask: url(../img/seal.svg) center / contain no-repeat; }
.badge-verified .ico { width: 58% !important; height: 58% !important; stroke-width: 3.6; color: #fff; stroke: #fff; }
.cl .tx b .badge-verified, .vwho b .badge-verified, .cm-head b .badge-verified, .who .badge-verified { width: 18px; height: 18px; }
