:root {
	--pulse-notes-fab-size: 44px;
	--pulse-notes-fab-bg: rgba(15, 23, 42, 0.92);
	--pulse-notes-fab-color: #f8fafc;
	--pulse-notes-fab-border: 1px solid rgba(148, 163, 184, 0.35);
	--pulse-notes-fab-shadow: 0 12px 28px rgba(2, 6, 23, 0.28);
	--pulse-notes-panel-bg: #ffffff;
	--pulse-notes-panel-color: #0f172a;
	--pulse-notes-panel-border: 1px solid rgba(148, 163, 184, 0.32);
	--pulse-notes-panel-shadow: 0 24px 48px rgba(2, 6, 23, 0.18);
	--pulse-notes-muted: #64748b;
	--pulse-notes-divider: rgba(148, 163, 184, 0.22);
	--pulse-notes-item-hover: rgba(15, 23, 42, 0.04);
	--pulse-notes-actions-fade: rgba(15, 23, 42, 0.1);
	--pulse-notes-action-hover-bg: rgba(15, 23, 42, 0.12);
}

@media (prefers-color-scheme: dark) {
	:root {
		--pulse-notes-panel-bg: #0f172a;
		--pulse-notes-panel-color: #e2e8f0;
		--pulse-notes-panel-border: 1px solid rgba(71, 85, 105, 0.55);
		--pulse-notes-panel-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
		--pulse-notes-muted: #94a3b8;
		--pulse-notes-divider: rgba(71, 85, 105, 0.55);
		--pulse-notes-item-hover: rgba(148, 163, 184, 0.12);
		--pulse-notes-fab-bg: rgba(226, 232, 240, 0.95);
		--pulse-notes-fab-color: #0f172a;
		--pulse-notes-fab-border: 1px solid rgba(71, 85, 105, 0.55);
		--pulse-notes-actions-fade: rgba(0, 0, 0, 0.4);
		--pulse-notes-action-hover-bg: rgba(255, 255, 255, 0.1);
	}
}

html[data-theme-mode='light'],
html[data-theme='light'] {
	--pulse-notes-panel-bg: #ffffff;
	--pulse-notes-panel-color: #0f172a;
	--pulse-notes-panel-border: 1px solid rgba(148, 163, 184, 0.32);
	--pulse-notes-panel-shadow: 0 24px 48px rgba(2, 6, 23, 0.18);
	--pulse-notes-muted: #64748b;
	--pulse-notes-divider: rgba(148, 163, 184, 0.22);
	--pulse-notes-item-hover: rgba(15, 23, 42, 0.04);
	--pulse-notes-actions-fade: rgba(15, 23, 42, 0.1);
	--pulse-notes-action-hover-bg: rgba(15, 23, 42, 0.12);
	--pulse-notes-fab-bg: rgba(15, 23, 42, 0.92);
	--pulse-notes-fab-color: #f8fafc;
	--pulse-notes-fab-border: 1px solid rgba(148, 163, 184, 0.35);
}

html[data-theme-mode='dark'],
html[data-theme='dark'] {
	--pulse-notes-panel-bg: #0f172a;
	--pulse-notes-panel-color: #e2e8f0;
	--pulse-notes-panel-border: 1px solid rgba(71, 85, 105, 0.55);
	--pulse-notes-panel-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
	--pulse-notes-muted: #94a3b8;
	--pulse-notes-divider: rgba(71, 85, 105, 0.55);
	--pulse-notes-item-hover: rgba(148, 163, 184, 0.12);
	--pulse-notes-actions-fade: rgba(0, 0, 0, 0.4);
	--pulse-notes-action-hover-bg: rgba(255, 255, 255, 0.1);
	--pulse-notes-fab-bg: rgba(226, 232, 240, 0.95);
	--pulse-notes-fab-color: #0f172a;
	--pulse-notes-fab-border: 1px solid rgba(71, 85, 105, 0.55);
}

.pulse-notes-fab {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 9990;
	width: var(--pulse-notes-fab-size);
	height: var(--pulse-notes-fab-size);
	border-radius: 9999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: var(--pulse-notes-fab-border);
	background: var(--pulse-notes-fab-bg);
	color: var(--pulse-notes-fab-color);
	cursor: pointer;
	box-shadow: var(--pulse-notes-fab-shadow);
	transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.pulse-notes-fab:hover {
	transform: translateY(-1px);
	box-shadow: 0 16px 32px rgba(2, 6, 23, 0.32);
	filter: brightness(1.05);
}

.pulse-notes-fab:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.pulse-notes-fab svg {
	width: 20px;
	height: 20px;
	display: block;
}

.pulse-notes-fab__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9999px;
	background: #ef4444;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 2px 6px rgba(2, 6, 23, 0.25);
	display: none;
}

.pulse-notes-fab__badge[data-visible='true'] {
	display: inline-block;
}

.pulse-notes-panel {
	position: fixed;
	right: 1.25rem;
	bottom: calc(1.25rem + var(--pulse-notes-fab-size) + 0.5rem);
	z-index: 9991;
	width: 420px;
	max-width: calc(100vw - 2rem);
	max-height: min(82vh, 640px);
	display: none;
	flex-direction: column;
	background: var(--pulse-notes-panel-bg);
	color: var(--pulse-notes-panel-color);
	border: var(--pulse-notes-panel-border);
	border-radius: 14px;
	box-shadow: var(--pulse-notes-panel-shadow);
	overflow: hidden;
	font-family: inherit;
}

.pulse-notes-panel[data-open='true'] {
	display: flex;
	animation: pulse-notes-pop 0.16s ease-out;
}

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

.pulse-notes-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--pulse-notes-divider);
}

.pulse-notes-panel__title {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.95rem;
	font-weight: 600;
	margin: 0;
}

.pulse-notes-panel__count {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--pulse-notes-muted);
	background: var(--pulse-notes-item-hover);
	padding: 0.1rem 0.45rem;
	border-radius: 9999px;
}

.pulse-notes-panel__actions {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.pulse-notes-panel__icon-btn {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--pulse-notes-muted);
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.pulse-notes-panel__icon-btn:hover {
	background: var(--pulse-notes-item-hover);
	color: var(--pulse-notes-panel-color);
}

.pulse-notes-panel__icon-btn svg {
	width: 16px;
	height: 16px;
	display: block;
}

.pulse-notes-panel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0.25rem 0;
}

.pulse-notes-panel__sections {
	display: flex;
	flex-direction: column;
}

.pulse-notes-panel__section + .pulse-notes-panel__section {
	border-top: 1px solid var(--pulse-notes-divider);
}

.pulse-notes-panel__section-header {
	padding: 0.75rem 0.9rem 0.45rem;
}

.pulse-notes-panel__section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.pulse-notes-panel__section-title {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pulse-notes-panel-color);
}

.pulse-notes-panel__section-count {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--pulse-notes-muted);
	background: var(--pulse-notes-item-hover);
	padding: 0.08rem 0.4rem;
	border-radius: 9999px;
}

.pulse-notes-panel__section-empty {
	margin: 0;
	padding: 0.35rem 0.9rem 0.85rem;
	font-size: 0.78rem;
	color: var(--pulse-notes-muted);
	font-style: italic;
}

.pulse-notes-panel__section .pulse-notes-panel__list {
	padding-bottom: 0.15rem;
}

.pulse-notes-panel__state {
	padding: 1.25rem 1rem;
	font-size: 0.85rem;
	color: var(--pulse-notes-muted);
	text-align: center;
}

.pulse-notes-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pulse-notes-item {
	position: relative;
	display: flex;
	gap: 0.6rem;
	padding: 0.65rem 0.9rem;
	cursor: pointer;
	border-bottom: 1px solid var(--pulse-notes-divider);
	transition: background-color 0.12s ease;
}

.pulse-notes-item:last-child {
	border-bottom: none;
}

.pulse-notes-item:hover {
	background: var(--pulse-notes-item-hover);
}

.pulse-notes-item[aria-disabled='true'] {
	cursor: default;
	opacity: 0.65;
}

.pulse-notes-item[aria-disabled='true']:hover {
	background: transparent;
}

.pulse-notes-item__actions {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 50%;
	display: inline-flex;
	align-items: stretch;
	justify-content: flex-end;
	gap: 0;
	background: linear-gradient(
		to right,
		transparent 0%,
		var(--pulse-notes-actions-fade) 100%
	);
	opacity: 0;
	/* Container itself never intercepts clicks — only the buttons do.
	   This keeps the left half of the row clickable to open the detail view
	   even when its gradient overlay is visually present on hover. */
	pointer-events: none;
	transition: opacity 0.14s ease;
}

.pulse-notes-item:hover .pulse-notes-item__actions,
.pulse-notes-item:focus-within .pulse-notes-item__actions {
	opacity: 1;
}

.pulse-notes-item__action {
	align-self: stretch;
	aspect-ratio: 1 / 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--pulse-notes-muted);
	cursor: pointer;
	pointer-events: none;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.pulse-notes-item:hover .pulse-notes-item__action,
.pulse-notes-item:focus-within .pulse-notes-item__action {
	pointer-events: auto;
}

.pulse-notes-item__action svg {
	width: 22px;
	height: 22px;
	display: block;
}

.pulse-notes-item__action:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.pulse-notes-item__action[disabled] {
	opacity: 0.45;
	cursor: wait;
	pointer-events: none;
}

.pulse-notes-item__action:hover {
	background: var(--pulse-notes-action-hover-bg);
	color: var(--pulse-notes-panel-color);
}

.pulse-notes-item__action-divider {
	flex-shrink: 0;
	align-self: stretch;
	width: 1px;
	margin: 0.6rem 0;
	background: var(--pulse-notes-divider);
	pointer-events: none;
}

.pulse-notes-item--confirming-delete {
	cursor: default;
	background: var(--pulse-notes-item-hover);
}

.pulse-notes-item--confirming-delete:hover {
	background: var(--pulse-notes-item-hover);
}

.pulse-notes-item--confirming-delete .pulse-notes-item__actions {
	opacity: 1;
}

.pulse-notes-item--confirming-delete .pulse-notes-item__action {
	pointer-events: auto;
}

.pulse-notes-item__snippet--confirm strong {
	font-weight: 600;
}

.pulse-notes-item__color {
	flex-shrink: 0;
	width: 8px;
	border-radius: 4px;
	margin-top: 0.2rem;
	margin-bottom: 0.2rem;
	background: #94a3b8;
}

.pulse-notes-item__color[data-color='red'] {
	background: #ef4444;
}
.pulse-notes-item__color[data-color='blue'] {
	background: #3b82f6;
}
.pulse-notes-item__color[data-color='green'] {
	background: #22c55e;
}
.pulse-notes-item__color[data-color='yellow'] {
	background: #eab308;
}
.pulse-notes-item__color[data-color='purple'] {
	background: #a855f7;
}

.pulse-notes-item__content {
	flex: 1 1 auto;
	min-width: 0;
}

.pulse-notes-item__snippet {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--pulse-notes-panel-color);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0 0 0.2rem;
	line-height: 1.35;
	word-break: break-word;
}

.pulse-notes-item__snippet--empty {
	font-style: italic;
	color: var(--pulse-notes-muted);
	font-weight: 400;
}

.pulse-notes-item__meta {
	font-size: 0.72rem;
	color: var(--pulse-notes-muted);
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	line-height: 1.3;
}

.pulse-notes-item__preview {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1 1 100%;
}

.pulse-notes-item__meta-sep {
	opacity: 0.55;
}

.pulse-notes-panel__footer {
	padding: 0.5rem 0.9rem;
	border-top: 1px solid var(--pulse-notes-divider);
	font-size: 0.72rem;
	color: var(--pulse-notes-muted);
	display: none;
}

.pulse-notes-panel__footer[data-visible='true'] {
	display: block;
}

.pulse-notes-compose {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem 0.9rem 0.9rem;
}

.pulse-notes-compose__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.pulse-notes-compose__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.18rem 0.45rem 0.18rem 0.55rem;
	border-radius: 9999px;
	background: var(--pulse-notes-item-hover);
	color: var(--pulse-notes-panel-color);
	font-size: 0.72rem;
	max-width: 100%;
}

.pulse-notes-compose__chip-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 13rem;
}

.pulse-notes-compose__chip-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--pulse-notes-muted);
	cursor: pointer;
	border-radius: 9999px;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.pulse-notes-compose__chip-remove:hover {
	background: rgba(239, 68, 68, 0.18);
	color: #ef4444;
}

.pulse-notes-compose__chip-remove svg {
	width: 11px;
	height: 11px;
	display: block;
}

.pulse-notes-compose__readonly {
	border-left: 3px solid var(--pulse-notes-divider);
	padding: 0.45rem 0.6rem;
	background: var(--pulse-notes-item-hover);
	border-radius: 0 8px 8px 0;
	font-size: 0.8rem;
	color: var(--pulse-notes-panel-color);
	white-space: pre-wrap;
	word-break: break-word;
}

.pulse-notes-compose__readonly-label {
	display: block;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pulse-notes-muted);
	margin-bottom: 0.2rem;
}

.pulse-notes-compose__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.pulse-notes-compose__label {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--pulse-notes-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pulse-notes-compose__input,
.pulse-notes-compose__textarea {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--pulse-notes-divider);
	border-radius: 8px;
	background: var(--pulse-notes-panel-bg);
	color: var(--pulse-notes-panel-color);
	font-size: 0.85rem;
	font-family: inherit;
	box-sizing: border-box;
	transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pulse-notes-compose__textarea {
	resize: vertical;
	min-height: 96px;
	max-height: 220px;
	line-height: 1.4;
}

.pulse-notes-compose__input:focus,
.pulse-notes-compose__textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.pulse-notes-compose__colors {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.pulse-notes-compose__color {
	width: 22px;
	height: 22px;
	border-radius: 9999px;
	border: 2px solid transparent;
	background: #94a3b8;
	cursor: pointer;
	padding: 0;
	transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.16s ease;
}

.pulse-notes-compose__color[data-color='red'] {
	background: #ef4444;
}
.pulse-notes-compose__color[data-color='blue'] {
	background: #3b82f6;
}
.pulse-notes-compose__color[data-color='green'] {
	background: #22c55e;
}
.pulse-notes-compose__color[data-color='yellow'] {
	background: #eab308;
}
.pulse-notes-compose__color[data-color='purple'] {
	background: #a855f7;
}

.pulse-notes-compose__color:hover {
	transform: scale(1.08);
}

.pulse-notes-compose__color[aria-pressed='true'] {
	border-color: var(--pulse-notes-panel-color);
	box-shadow: 0 0 0 2px var(--pulse-notes-panel-bg) inset;
}

.pulse-notes-compose__error {
	display: none;
	font-size: 0.75rem;
	color: #ef4444;
	margin: 0;
}

.pulse-notes-compose__error[data-visible='true'] {
	display: block;
}

.pulse-notes-compose__actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.4rem;
	margin-top: 0.15rem;
}

.pulse-notes-btn {
	padding: 0.4rem 0.85rem;
	border-radius: 8px;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	font-family: inherit;
	transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.pulse-notes-btn--ghost {
	background: transparent;
	color: var(--pulse-notes-panel-color);
	border-color: var(--pulse-notes-divider);
}

.pulse-notes-btn--ghost:hover {
	background: var(--pulse-notes-item-hover);
}

.pulse-notes-btn--primary {
	background: #2563eb;
	color: #ffffff;
	border-color: #2563eb;
}

.pulse-notes-btn--primary:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
}

.pulse-notes-btn[disabled] {
	opacity: 0.55;
	cursor: wait;
}

.pulse-notes-detail {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 0.75rem 0.9rem 1rem;
}

.pulse-notes-detail__back {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.25rem 0.5rem 0.25rem 0.35rem;
	border-radius: 8px;
	border: none;
	background: transparent;
	color: var(--pulse-notes-muted);
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.pulse-notes-detail__back:hover {
	background: var(--pulse-notes-item-hover);
	color: var(--pulse-notes-panel-color);
}

.pulse-notes-detail__back svg {
	width: 14px;
	height: 14px;
	display: block;
}

.pulse-notes-detail__type {
	display: inline-flex;
	align-self: flex-start;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pulse-notes-muted);
	background: var(--pulse-notes-item-hover);
	padding: 0.18rem 0.45rem;
	border-radius: 9999px;
}

.pulse-notes-detail__title-row {
	display: flex;
	gap: 0.55rem;
	align-items: flex-start;
}

.pulse-notes-detail__color {
	flex-shrink: 0;
	width: 10px;
	border-radius: 4px;
	margin-top: 0.3rem;
	margin-bottom: 0.3rem;
	background: #94a3b8;
}

.pulse-notes-detail__color[data-color='red'] {
	background: #ef4444;
}
.pulse-notes-detail__color[data-color='blue'] {
	background: #3b82f6;
}
.pulse-notes-detail__color[data-color='green'] {
	background: #22c55e;
}
.pulse-notes-detail__color[data-color='yellow'] {
	background: #eab308;
}
.pulse-notes-detail__color[data-color='purple'] {
	background: #a855f7;
}

.pulse-notes-detail__color[data-color=''] {
	display: none;
}

.pulse-notes-detail__title {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
	color: var(--pulse-notes-panel-color);
	word-break: break-word;
}

.pulse-notes-detail__title--muted {
	color: var(--pulse-notes-muted);
	font-style: italic;
	font-weight: 500;
}

.pulse-notes-detail__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	font-size: 0.75rem;
	color: var(--pulse-notes-muted);
	line-height: 1.3;
}

.pulse-notes-detail__meta-sep {
	opacity: 0.55;
}

.pulse-notes-detail__highlight {
	border-left: 3px solid var(--pulse-notes-divider);
	padding: 0.5rem 0.75rem;
	background: var(--pulse-notes-item-hover);
	border-radius: 0 8px 8px 0;
	font-size: 0.82rem;
	color: var(--pulse-notes-panel-color);
	white-space: pre-wrap;
	word-break: break-word;
}

.pulse-notes-detail__highlight-label {
	display: block;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pulse-notes-muted);
	margin-bottom: 0.2rem;
}

.pulse-notes-detail__body {
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--pulse-notes-panel-color);
	word-break: break-word;
}

.pulse-notes-detail__body p {
	margin: 0 0 0.6rem;
}

.pulse-notes-detail__body p:last-child {
	margin-bottom: 0;
}

.pulse-notes-detail__body ul,
.pulse-notes-detail__body ol {
	margin: 0 0 0.6rem;
	padding-left: 1.4rem;
}

.pulse-notes-detail__body img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

.pulse-notes-detail__body--empty {
	font-style: italic;
	color: var(--pulse-notes-muted);
}

.pulse-notes-detail__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: flex-end;
	margin-top: 0.3rem;
}

@media (max-width: 480px) {
	.pulse-notes-panel {
		right: 0.75rem;
		left: 0.75rem;
		width: auto;
		max-width: none;
	}
}
