/*
 * site.css — single-owner site overrides, loaded last.
 * Layout and visibility only (no colours), so the light / mint / dark themes
 * are untouched. !important is deliberate: app.js toggles the `hidden`
 * attribute on several of these and would otherwise win.
 */

/* There is no Google sign-in, shared demo or admin on this site. */
#auth-panel,
#demo-edit-bar,
#auth-login-button,
#auth-admin-link {
  display: none !important;
}

/* ── Visitor chrome (body.is-authenticated is set by app.js syncAuthUi) ── */
body:not(.is-authenticated) #auth-controls,
body:not(.is-authenticated) #mobile-quick-add-btn,
body:not(.is-authenticated) #mobile-quick-add-panel,
body:not(.is-authenticated) [data-nav-page="bin"],
body:not(.is-authenticated) #floating-bulk-actions-bar,
body:not(.is-authenticated) #profile-floating-bulk-actions-bar {
  display: none !important;
}

/* Keep the grid track (hero is `auto 1fr auto` on desktop) but show nothing. */
body:not(.is-authenticated) #hero-topbar-search {
  visibility: hidden;
  pointer-events: none;
}

/* Four buttons once the [+] is gone. */
body:not(.is-authenticated) .mobile-nav-inner {
  grid-template-columns: repeat(4, 1fr);
}

/* Owner-only affordances on public profile cards. profile.js already skips
   them for visitors; these rules are the backstop. */
.profile-page.is-public .paper-refresh-link,
.profile-page.is-public .paper-extra-links-add-row,
.profile-page.is-public .paper-extra-link-add,
.profile-page.is-public .paper-extra-link-remove,
.profile-page.is-public .paper-private-lock,
.profile-page.is-public .paper-meta .paper-edit,
.profile-page.is-public .paper-meta .paper-delete {
  display: none !important;
}

/* Replaces an inline style="" (the page CSP has no 'unsafe-inline'). */
.scholar-cancel-btn-spaced {
  margin-top: 6px;
}

/* Owner entry point in the footer: quiet, same look as the footer text. */
.footer-owner-link {
  color: inherit;
}

/* Owner token dialog (js/owner-ui.js). Colours come from the theme tokens. */
.owner-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  background: var(--panel-strong);
  color: var(--text);
}
.owner-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.owner-dialog-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.owner-dialog-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.owner-dialog-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px; /* no zoom-on-focus on phones */
}
.owner-dialog-error {
  min-height: 1.3em;
  margin: 8px 0 0;
  font-size: 0.85rem;
}
.owner-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Status pill while the owner is unlocked; above the mobile bottom nav. */
.owner-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 0.8rem;
  cursor: default;
}
.owner-pill.is-error {
  cursor: pointer;
  border-color: var(--danger-fg);
  color: var(--danger-fg);
}
.owner-dialog-error:not(:empty) {
  color: var(--danger-fg);
}
.owner-pill:not(.is-error) {
  cursor: pointer;
}

/* Decision banner (conflict with another device, large deletion). */
.owner-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  width: min(560px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--danger-fg);
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}
.owner-banner-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.owner-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 700px) {
  .owner-pill {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}
