.funify-notes-page .site-header .site-menu .notes-activity-mobile-trigger {
  display: none;
}

.funify-notes-page .site-header .site-menu .notes-activity-mobile-trigger::before {
  content: none;
}

/* Local Activity and Notifications use the workspace's existing theme tokens. */
.notes-workspace-drive-heading {
  gap: 4px;
}

.notes-workspace-drive-copy {
  flex: 1 1 auto;
}

.notes-workspace-drive-copy > :is(strong, span) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funify-notes-page .notes-event-panel {
  position: fixed;
  inset: auto 20px calc(20px + env(safe-area-inset-bottom, 0px)) auto;
  z-index: 1150;
  width: min(380px, calc(100vw - 32px));
  max-width: none;
  max-height: min(65dvh, 640px, calc(100dvh - 160px));
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 12px 36px rgb(20 35 65 / 16%);
  font-family: inherit;
  font-size: 13px;
}

#notesActivityPanel {
  z-index: 1160;
}

.funify-notes-page .notes-event-panel[open] {
  display: flex;
  flex-direction: column;
  animation: notes-event-enter 160ms ease-out;
}

.funify-notes-page .notes-event-panel[hidden] {
  display: none;
}

.notes-event-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 18px;
}

.notes-event-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.funify-notes-page .notes-event-panel svg,
.funify-notes-page .notes-activity-trigger svg,
.funify-notes-page .notes-activity-mobile-trigger svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notes-event-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.notes-workspace-floating-activity {
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.funify-notes-page .notes-workspace-floating-activity svg {
  width: 22px;
  height: 22px;
}

.notes-event-close:hover {
  background: var(--notes-workspace-soft);
  color: var(--color-text);
}

.notes-event-tabs {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--color-border);
}

.notes-event-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.notes-event-button:hover:not(:disabled),
.notes-event-tabs [aria-selected='true'] {
  background: var(--notes-workspace-soft);
  color: var(--color-text);
}

.notes-event-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.notes-event-tabs [role='tab'] {
  flex: 1;
}

.notes-event-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notes-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 4px 0;
  padding: 12px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
}

button.notes-event-row {
  cursor: pointer;
}

.notes-event-row[data-unread='true'],
button.notes-event-row:hover {
  background: var(--notes-workspace-soft);
}

.notes-event-row > svg {
  margin-top: 2px;
  color: var(--notes-status-local-only, #587abc);
}

.notes-event-row[data-level='success'] > svg {
  color: var(--notes-status-synced, #279575);
}

.notes-event-row[data-level='warning'] > svg {
  color: #bd7a24;
}

.notes-event-row[data-level='error'] > svg {
  color: #d76262;
}

.notes-event-row-copy {
  display: grid;
  flex: 1 1 0;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.notes-event-row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.notes-event-row-heading strong {
  flex: 1 1 auto;
  min-width: 0;
}

.notes-event-row-heading time {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.notes-event-api-counts {
  white-space: pre-line;
}

.notes-event-row strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.notes-event-row p,
.notes-event-empty p {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.6;
}

.notes-event-row time,
.notes-event-count {
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.5;
}

.notes-event-row code {
  font-size: 11px;
}

.notes-event-usage-status {
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 12px;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-event-footer {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  padding: 8px;
  border-top: 1px solid var(--color-border);
}

.notes-event-empty {
  display: grid;
  gap: 6px;
  padding: 24px 10px;
  text-align: center;
}

.notes-event-empty strong {
  font-size: 13px;
}

.notes-event-feedback {
  flex: none;
  margin: 0;
  padding: 8px 18px;
  color: var(--color-muted);
  font-size: 11px;
}

#notesNotificationsBtn {
  position: relative;
}

.notes-notification-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--color-surface);
  border-radius: 50%;
  background: #d76262;
  pointer-events: none;
}

.notes-activity-mobile-trigger,
.notes-event-handle {
  display: none;
}

.notes-activity-drive-slot:empty {
  display: none;
}

.funify-notes-page .notes-event-panel :is(button, a):focus-visible {
  outline: 2px solid var(--notes-selection-accent, #577cd3);
  outline-offset: -2px;
}

@keyframes notes-event-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1024px) {
  .funify-notes-page .notes-event-panel {
    inset: auto 0 var(--notes-event-keyboard, 0px);
    width: 100%;
    max-height: min(80dvh, calc(var(--notes-event-height, 100dvh) - 24px));
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 16px 16px 0 0;
  }

  .notes-event-panel::backdrop {
    background: rgb(15 23 42 / 30%);
  }

  .notes-event-handle {
    display: block;
    flex: none;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 3px;
    background: var(--color-border);
  }

  .notes-event-panel .notes-event-button,
  .notes-event-close {
    min-height: 44px;
  }

  .notes-event-close {
    width: 44px;
  }

  html[data-notes-access='unlocked']
    .funify-notes-page
    .site-header
    .site-menu
    .notes-activity-mobile-trigger {
    display: flex;
    min-height: 44px;
  }

  .notes-activity-drive-slot .notes-workspace-drive-connections {
    margin: 0 16px 10px;
    padding: 0;
    border: 0;
  }

  body.notes-event-modal-open {
    position: fixed;
    top: var(--notes-event-scroll, 0);
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }
}

html:not([data-notes-access='unlocked']) :is(.notes-activity-mobile-trigger, .notes-event-panel) {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .funify-notes-page .notes-event-panel[open] {
    animation: none;
  }
}

@media print {
  .notes-event-panel,
  .notes-activity-mobile-trigger,
  .notes-activity-trigger {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .funify-notes-page[data-notes-activity-open] .notes-workspace-floating-create {
    bottom: var(--notes-activity-create-bottom);
  }

  .funify-notes-page[data-notes-activity-open] .notes-workspace-floating-activity {
    bottom: calc(var(--notes-activity-create-bottom) + 60px);
  }

  .funify-notes-page[data-notes-activity-open] .notes-workspace-create-menu {
    z-index: 1170;
  }
}

/* The overlay follows the Activity stroke from its left endpoint to its right endpoint. */
.notes-activity-icon .notes-activity-icon-sweep {
  display: none;
  stroke: #10b981;
  stroke-dasharray: 22 100;
  stroke-dashoffset: 22;
}

.notes-activity-icon[data-working] .notes-activity-icon-sweep {
  display: block;
  animation: notes-activity-sweep 1.6s linear infinite;
}

@keyframes notes-activity-sweep {
  from {
    stroke-dashoffset: 22;
  }

  to {
    stroke-dashoffset: -100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-activity-icon[data-working] .notes-activity-icon-sweep {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}

.notes-activity-icon[data-working] {
  box-sizing: content-box;
  margin: -2px;
  padding: 2px;
  border-radius: 5px;
  background: color-mix(in srgb, #10b981 14%, var(--color-surface));
}

.notes-event-heading-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.notes-event-icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 32px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.notes-event-icon-button:hover:not(:disabled) {
  background: var(--notes-workspace-soft);
  color: var(--color-text);
}

.notes-event-icon-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.notes-event-action-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .notes-event-icon-button {
    width: 44px;
    height: 44px;
  }
}

.notes-notification-card {
  position: relative;
  margin: 4px 0;
}

.notes-notification-card .notes-event-row {
  margin: 0;
  padding-right: 40px;
}

.notes-notification-dismiss {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 26px;
  height: 26px;
  padding: 4px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.notes-notification-dismiss:hover {
  background: var(--notes-workspace-soft);
  color: var(--color-text);
}

.notes-notification-dismiss:focus-visible {
  outline: 2px solid var(--notes-selection-accent);
  outline-offset: 1px;
}

.notes-event-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.notes-event-filters :is(input, select) {
  box-sizing: border-box;
  flex: 1 1 120px;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  font: inherit;
}

.notes-event-row-copy pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.notes-event-row-copy details :is(a, button) {
  display: inline-block;
  min-height: 44px;
  margin-inline-end: 12px;
}
