/* Sence Ben live5: profile photos, profile header, admin button + admin panel (#admin). */

/* --- Avatars with Google / X photos (initials stay underneath as fallback) --- */
.avatar { position: relative; overflow: hidden; }
.avatar .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; }
.avatar.has-photo .avatar-initials { visibility: hidden; }
.avatar-large { width: 58px !important; height: 58px !important; font-size: 18px; }
.profile-identity { display: flex; align-items: center; gap: 14px; padding: 4px 0 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.profile-identity-text { display: grid; gap: 2px; min-width: 0; }
.profile-identity-text strong { font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity-text span { color: var(--muted); font-size: 12.5px; }
.admin-link { width: 100%; margin-top: 10px; }

/* Signed-in photo inside the account buttons (desktop header + mobile nav). */
.account-avatar { width: 24px !important; height: 24px !important; font-size: 9px; border: 1px solid var(--line); }
.account-button .account-avatar { margin-right: 2px; }
@media (max-width: 760px) { .account-button .account-avatar { display: grid !important; } }
.mobile-nav [data-action="account"] .account-avatar { width: 24px !important; height: 24px !important; }

/* --- Admin button in the top bar (only rendered for admins) --- */
.admin-button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 11px; border-radius: 999px; border: 1px solid #cfe5d7; background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 800; }
.admin-button svg { width: 16px; height: 16px; }
.admin-button:hover { background: #d6eddf; }
@media (max-width: 650px) {
  .admin-button { min-height: 36px; min-width: 36px; padding: 5px 9px; font-size: 11px; justify-content: center; }
  .admin-button > span:not([data-icon]) { display: none; }
}

/* --- Admin panel (full-screen view, mobile first) --- */
body.admin-open { overflow: hidden; }
.admin-view { position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink); -webkit-overflow-scrolling: touch; }
.admin-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: #ffffffef; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.admin-back, .admin-refresh { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.admin-refresh[disabled] svg { animation: admin-spin 1s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }
.admin-title-wrap { flex: 1; min-width: 0; }
.admin-title-wrap h2 { margin: 0; font: 400 26px/1 var(--serif); letter-spacing: -.01em; outline: none; }
.admin-title-wrap span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.admin-body { max-width: 1080px; margin: 0 auto; padding: 14px 14px calc(28px + env(safe-area-inset-bottom)); }
.admin-status { padding: 30px 6px; text-align: center; color: var(--muted); }
.admin-status.error { color: var(--no); }
.admin-section { margin-bottom: 14px; }
.admin-heading { margin: 4px 2px 10px; font-size: 15px; }
.admin-heading small { color: var(--muted); font-weight: 500; font-size: 12px; }
.admin-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.admin-card.accent { background: linear-gradient(140deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff; }
.admin-card.accent .admin-card-label, .admin-card.accent .admin-card-detail { color: #ffffffd9; }
.admin-card.accent .admin-pill { background: #ffffff26; color: #fff; }
.admin-card.warn { border-color: #f1c7c5; background: var(--no-soft); }
.admin-card-label { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.admin-card-value { font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.admin-card-detail { display: flex; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 11.5px; }
.admin-pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 750; white-space: nowrap; }
.admin-pill.real { background: var(--accent-soft); color: var(--accent-deep); }
.admin-pill.seed { background: #f1efe6; color: #6f6a55; }
.admin-two { display: grid; gap: 10px; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; min-width: 0; }
.admin-panel h3 { margin: 0 0 10px; font-size: 13.5px; }
.admin-split { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef0ea; gap: 2px; }
.admin-split-part { flex-basis: 0; min-width: 0; }
.admin-split-empty { flex: 1; }
.admin-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 10px 0 0; padding: 0; font-size: 12.5px; }
.admin-legend li { display: inline-flex; align-items: center; gap: 5px; }
.admin-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.admin-legend small { color: var(--muted); }
.admin-view .t-google { background: #4c7be0; } .admin-view .t-x { background: #15251e; } .admin-view .t-email { background: #c79a3b; } .admin-view .t-other, .admin-view .t-seed { background: #9aa39d; }
.admin-view .t-yes { background: var(--accent); } .admin-view .t-no { background: var(--accent-red); }
.admin-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.admin-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-chart { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 11px 11px 8px; min-width: 0; }
.admin-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.admin-chart figcaption b { color: var(--ink); font-size: 17px; }
.admin-chart svg { width: 100%; height: 92px; overflow: visible; }
.admin-bar.c1 { fill: var(--accent); } .admin-bar.c2 { fill: #c79a3b; } .admin-bar.c3 { fill: #4c7be0; } .admin-bar.c4 { fill: var(--accent-red); }
.admin-bar-max { font-size: 10px; font-weight: 700; fill: var(--ink); }
.admin-axis { font-size: 9.5px; fill: var(--muted); }
.admin-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; counter-reset: rank; }
.admin-posts li { counter-increment: rank; position: relative; padding-left: 26px; }
.admin-posts li::before { content: counter(rank); position: absolute; left: 0; top: 1px; width: 19px; height: 19px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.admin-post-title { font-weight: 700; font-size: 13.5px; text-decoration: none; margin-right: 6px; }
.admin-post-title:hover { text-decoration: underline; }
.admin-post-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.admin-yes { color: var(--yes); font-weight: 750; }
.admin-mini-bar { height: 5px; border-radius: 999px; background: var(--no-soft); margin-top: 5px; overflow: hidden; }
.admin-mini-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.admin-signups { list-style: none; margin: 0; padding: 0; display: grid; }
.admin-signups li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #eef1ec; min-width: 0; }
.admin-signups li:first-child { border-top: 0; padding-top: 0; }
.admin-signups li > div:not(.admin-signup-side) { display: grid; min-width: 0; flex: 1; }
.admin-signups strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-signups li > div span { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-signup-side { display: grid; justify-items: end; gap: 3px; flex: none; }
.admin-signup-side time { color: var(--muted); font-size: 11px; }
.admin-avatar { width: 34px; height: 34px; font-size: 12px; }
.admin-provider { padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: #fff; }
.admin-empty { margin: 0; color: var(--muted); font-size: 13px; }
.admin-footnote { color: var(--muted); font-size: 11.5px; margin: 6px 2px 0; }
@media (min-width: 720px) {
  .admin-top { padding: 12px 24px; }
  .admin-body { padding: 20px 24px 40px; }
  .admin-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-charts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-two { grid-template-columns: 1fr 1fr; }
}
