/* ---------- Context menu ---------- */
.menu {
  position: fixed;
  z-index: var(--z-menu);
  min-width: 184px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: menuIn 0.12s var(--ease);
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.menu[hidden] {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item.danger {
  color: var(--danger);
}

.menu-item.danger:hover {
  background: var(--danger-soft);
}

.menu-ico {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.95em;
  opacity: 0.85;
}

.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.menu-kbd {
  margin-left: auto;
  padding-left: 12px;
  font-size: var(--fs-xs);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Modals ---------- */
.modal {
  margin: auto;
  width: min(92vw, 420px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

.modal::backdrop {
  background: rgb(0 0 0 / 0.4);
  backdrop-filter: blur(3px);
}

.modal[open] {
  animation: modalIn 0.2s var(--ease);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-form {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: -8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
}

.field-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  font-size: var(--fs-base);
  width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

select.field-input {
  cursor: pointer;
}

textarea.field-input {
  height: auto;
  padding: 8px 12px;
  resize: vertical;
}

.field-input::placeholder {
  color: var(--faint);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-error {
  font-size: var(--fs-sm);
  color: var(--danger);
}

.field-notice {
  font-size: var(--fs-sm);
  color: var(--accent-text);
}

/* "Forgot password?" link — right-aligned, sits just under the password field */
.auth-forgot {
  align-self: flex-end;
  margin-top: -8px;
  padding: 0;
}

/* OAuth (Google) sign-in + "or" divider */
.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.auth-google-icon {
  flex: none;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.link-btn {
  font-size: var(--fs-sm);
  color: var(--accent-text);
  text-align: center;
  padding: 4px;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ---------- Profile menu ---------- */
.profile {
  position: relative;
}

/* The avatar IS the button — one single circle (no nested ring).
   #profile-btn + #profile-avatar must both stay in the DOM (auth.js /
   markerSetProfile drive them by ID), so the button is just an invisible
   wrapper and the avatar carries all the visuals. */
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 3px 8px 3px 3px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.profile-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.profile-btn-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.profile-btn-caret {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

/* tight on phones: show just the avatar */
@media (max-width: 640px) {
  .profile-btn-name,
  .profile-btn-caret {
    display: none;
  }
  .profile-btn {
    padding: 3px;
  }
}

.profile-btn-caret {
  transition: transform var(--dur) var(--ease);
}

.profile-btn[aria-expanded="true"] .profile-btn-caret {
  transform: rotate(180deg);
}

/* ---------- Account dropdown menu ---------- */
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: var(--z-menu);
  animation: profileMenuIn 0.14s var(--ease);
}

.profile-menu-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  padding: 14px 12px;
}

.profile-menu-name {
  max-width: 100%;
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-email {
  max-width: 100%;
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  color: oklch(0.52 0.11 75);
  background: oklch(0.95 0.05 75);
  border: 1px solid oklch(0.85 0.09 75);
  transition: background var(--dur) var(--ease);
}

.profile-upgrade:hover {
  background: oklch(0.92 0.07 75);
}

[data-theme="dark"] .profile-upgrade {
  color: oklch(0.86 0.13 85);
  background: oklch(0.32 0.06 75);
  border-color: oklch(0.45 0.08 75);
}

[data-theme="dark"] .profile-upgrade:hover {
  background: oklch(0.36 0.07 75);
}

.profile-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.profile-menu-item:hover {
  background: var(--surface-2);
}

.profile-menu-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex-shrink: 0;
}

@keyframes profileMenuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-menu {
    animation: none;
  }
}

.avatar {
  display: inline-grid;
  place-items: center;
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Topbar account: the single visible circle = the avatar (matches the 34px theme button) */
#profile-avatar {
  width: 34px;
  height: 34px;
}

.avatar.signed-in {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
}

.avatar-ico {
  width: 17px;
  height: 17px;
}

.avatar-initial {
  display: none;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
}

.avatar.signed-in .avatar-ico {
  display: none;
}

.avatar.signed-in .avatar-initial {
  display: block;
}

/* Google profile photo (no upload) — covers the circle, hides icon + initial */
.avatar.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.avatar.has-photo .avatar-ico,
.avatar.has-photo .avatar-initial {
  display: none;
}

.avatar-lg {
  width: 40px;
  height: 40px;
}

.avatar-lg .avatar-ico {
  width: 22px;
  height: 22px;
}

.avatar-lg .avatar-initial {
  font-size: var(--fs-md);
}

.avatar-xl {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.avatar-xl .avatar-ico {
  width: 28px;
  height: 28px;
}

.avatar-xl .avatar-initial {
  font-size: var(--fs-lg);
}

/* identity block (account header inside the Settings → User Profile panel) */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--border);
}

/* pencil that opens the edit-profile modal — pushed to the far right */
.profile-edit-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.profile-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  font-size: var(--fs-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* danger variant of the ghost button (Sign out) */
.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* ---------- Settings modal (two-pane: nav + panels) ---------- */
.modal-settings {
  width: min(94vw, 780px);
}

.settings-shell {
  display: flex;
  /* Fixed size so the dialog never resizes when switching tabs.
     .settings-panels scrolls internally when a panel's content is taller. */
  height: min(88vh, 620px);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.settings-nav {
  flex: 0 0 196px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

.settings-nav-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
  padding: 2px 10px 12px;
}

.settings-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.settings-nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.settings-nav-item:hover {
  background: var(--surface);
  color: var(--ink);
}

.settings-nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.settings-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.settings-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.settings-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  color: var(--muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.settings-close svg {
  width: 17px;
  height: 17px;
}

.settings-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.settings-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-panels {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px 22px;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: settingsPanelIn 0.18s var(--ease);
}

.settings-panel[hidden] {
  display: none;
}

@keyframes settingsPanelIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.settings-panel-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 36px;
}

.settings-panel-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
}

.settings-panel-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Signed-in account management (Profile tab): clean, borderless rows — no
   boxes-in-boxes. Sections separated by hairlines + whitespace (quiet by default). */
#account-settings {
  display: flex;
  flex-direction: column;
}

#account-settings .settings-section {
  border: none;
  border-radius: 0;
  padding: 18px 0;
  gap: 10px;
  border-top: 1px solid var(--border);
}

#account-settings .settings-section:first-child {
  border-top: none;
  padding-top: 6px;
}

#account-settings .settings-h {
  font-size: var(--fs-md);
}

/* ---------- Account rows (Profile tab): avatar aside + label/value/action ---------- */
.acct-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.acct-aside {
  flex: 0 0 auto;
  padding-top: 2px;
}

.acct-rows {
  flex: 1 1 auto;
  min-width: 0;
}

.acct-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.acct-row:first-child {
  border-top: none;
  padding-top: 0;
}

/* Guest (Freemium) view shows only the Plan row — give it the same divider the
   signed-in rows get between them, so it doesn't sit borderless. */
.acct-guest .acct-row-plan {
  border-bottom: 1px solid var(--border);
}

/* Account/delete row: no label or description — span full width and left-align the link
   (sits under the Password row, flush with the other rows' left edge). */
.acct-row-account {
  grid-template-columns: 1fr;
}
.acct-row-account .acct-row-view {
  justify-content: flex-start;
}

.acct-row-label {
  font-size: var(--fs-base);
  color: var(--muted);
  padding-top: 3px;
}

.acct-row-body {
  min-width: 0;
}

.acct-row-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}

.acct-row-value {
  font-size: var(--fs-base);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.acct-row-value.muted {
  color: var(--muted);
}

.acct-link {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--accent-text);
  cursor: pointer;
}

.acct-link:hover {
  text-decoration: underline;
}

.acct-link.muted {
  color: var(--muted);
  font-weight: 400;
}

.acct-link.danger {
  color: var(--danger);
}

.acct-row-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.acct-edit-fields {
  display: flex;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 0;
}

.acct-edit-fields .field-input {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
}

.acct-edit-stack {
  flex-direction: column;
}

.acct-edit-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.acct-row-msg {
  margin-top: 8px;
}

@media (max-width: 560px) {
  .acct-layout {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  .acct-aside {
    padding-top: 0;
  }
  .acct-rows {
    width: 100%;
  }
  .acct-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .acct-edit-fields {
    flex-direction: column;
  }
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-form-row {
  display: flex;
  gap: 12px;
}

.settings-form-row .field {
  flex: 1 1 0;
  min-width: 0;
}

/* input + action button on one line (label sits above, button next to input) */
.field-inline {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.field-inline .field {
  flex: 1 1 auto;
  min-width: 0;
}

.field-inline .btn {
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .field-inline {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .settings-form-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-panel {
    animation: none;
  }
}

/* stack the nav above the panels on narrow screens */
@media (max-width: 560px) {
  .settings-shell {
    flex-direction: column;
    height: auto;
    max-height: 86vh;
  }

  .settings-nav {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 10px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .settings-nav-title {
    display: none;
  }

  .settings-nav-item {
    width: auto;
    white-space: nowrap;
  }

  .settings-nav-item.is-active::before {
    display: none;
  }
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
}

.settings-section-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-h {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
}

.settings-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.settings-help {
  font-size: var(--fs-sm);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 10px;
  background: var(--surface);
}

.settings-help summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}

.settings-help ol {
  margin: 8px 0 2px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-help code,
.settings-help kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0 5px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-status {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------- General Settings — feature on/off toggles ---------- */
.gs-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gs-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gs-row-label {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
}
.gs-row-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}
/* Switch — reuses the widgets-toggle look: --accent track + sliding knob when on. */
.gs-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.gs-switch {
  display: block;
  width: 38px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  position: relative;
  transition: background var(--dur) var(--ease);
}
.gs-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.gs-toggle[aria-checked="true"] .gs-switch {
  background: var(--accent);
}
.gs-toggle[aria-checked="true"] .gs-switch::after {
  transform: translateX(16px);
}
.gs-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-pill);
}
@media (prefers-reduced-motion: reduce) {
  .gs-switch,
  .gs-switch::after {
    transition: none;
  }
}

/* Feature hide rules — driven by the root class the General Settings toggles set
   (and the head pre-paint script). !important beats the JS-managed inline shutter
   sizing + the subscriptions tab-visibility logic so "off" wins on every tab. */
html.feat-activities-off .reserved-block,
html.feat-activities-off #reserved-resizer {
  display: none !important;
}
html.feat-subs-off #subscriptions-block {
  display: none !important;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: var(--z-toast);
  padding: 10px 16px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Connectivity / sync status pill ---------- */
.net-banner {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(92vw, 340px);
  padding: 9px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.net-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.net-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.net-banner.is-offline .net-dot {
  background: var(--danger);
  animation: net-pulse 1.4s var(--ease) infinite;
}

.net-banner.is-syncfail .net-dot {
  background: var(--warn);
}

.net-banner.is-online .net-dot {
  background: var(--accent);
}

@keyframes net-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (max-width: 760px) {
  .net-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}

/* ---------- Cookie notice (app, one-time acknowledgement) ----------
   Bottom-RIGHT so it never overlaps the bottom-left .net-banner or the
   bottom-center .toast. base.css [hidden]{display:none!important} hides it
   until the inline script un-hides for a first-time (un-dismissed) visitor. */
.cookie-notice {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 380px);
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-pop);
}
/* Both notices pin to the same bottom-right spot — if the PWA install hint is up, the
   cookie notice stacks above it instead of sitting underneath (they share a class). */
#install-hint:not([hidden]) ~ #cookie-notice:not([hidden]) {
  bottom: 100px;
}
.cookie-notice a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-notice a:hover {
  color: var(--ink);
}
.cookie-notice-ok {
  flex: none;
  padding: 6px 14px;
}
@media (max-width: 760px) {
  .cookie-notice {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
}

/* ---------- Legal links (auth modal + Settings→Profile) ----------
   Pages live on nookmarker.com; app links are absolute on purpose
   (they must work from app.nookmarker.com). Global `a` in base.css
   strips underline/color, so these need explicit affordances. */
.auth-legal {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 2px 0 0;
  text-align: center;
}
.settings-legal {
  margin-top: 18px;
}
.auth-legal a,
.settings-legal a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-legal a:hover,
.settings-legal a:hover {
  color: var(--ink);
}

/* Signup-only consent checkbox (clickwrap). Row layout overrides .field's column. */
.auth-consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
}
.auth-consent-box {
  flex: none;
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-consent a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-consent a:hover {
  color: var(--ink);
}
