@font-face {
    font-family: 'Comic Neue';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/comic-neue-700.woff2') format('woff2');
}

:root {
    --haayal-notes-brand: #4f22b1;
    --haayal-notes-brand-hover: #3d1a8c;

    /* Note type palette — shared across all note types */
    --haayal-warning-bg:        #fef2f2;
    --haayal-warning-border:    #d63638;
    --haayal-warning-text:      #8b1a1c;
    --haayal-important-bg:      #fff8e5;
    --haayal-important-border:  #dba617;
    --haayal-important-text:    #8a6d00;
    --haayal-info-bg:           #f0f6fc;
    --haayal-info-border:       #2271b1;
    --haayal-info-text:         #135e96;
    --haayal-tip-bg:            #edfaef;
    --haayal-tip-border:        #00a32a;
    --haayal-tip-text:          #0a5c1a;

    /* Sticky note gradients — default (subtle shading on the bg color) */
    --haayal-warning-gradient:   linear-gradient(145deg, #fef2f2 0%, #fde8e8 70%, #fbd9d9 100%);
    --haayal-important-gradient: linear-gradient(145deg, #fff8e5 0%, #fff0c8 70%, #ffe8b0 100%);
    --haayal-info-gradient:      linear-gradient(145deg, #f0f6fc 0%, #e3effa 70%, #d4e8f7 100%);
    --haayal-tip-gradient:       linear-gradient(145deg, #edfaef 0%, #dcf5e0 70%, #c9eece 100%);

    /* UI icon colors — kebab trigger and drag grip */
    --haayal-kebab-color:     #646970;
    --haayal-drag-grip-color: #8c8f94;
}

body.haayal-notes-vivid-colors {
    --haayal-warning-bg:         #f70f14;
    --haayal-warning-border:     #a50007;
    --haayal-warning-text:       #ffffff;
    --haayal-warning-gradient:   linear-gradient(145deg, #f70f14 0%, #d40a0f 70%, #b80008 100%);

    --haayal-important-bg:       #ffe85a;
    --haayal-important-border:   #c9a200;
    --haayal-important-text:     #1a1200;
    --haayal-important-gradient: linear-gradient(145deg, #ffe85a 0%, #ffd416 70%, #f0c800 100%);

    --haayal-info-bg:            #40a9ff;
    --haayal-info-border:        #096dd9;
    --haayal-info-text:          #ffffff;
    --haayal-info-gradient:      linear-gradient(145deg, #40a9ff 0%, #1890ff 70%, #0978df 100%);

    --haayal-tip-bg:             #73d13d;
    --haayal-tip-border:         #389e0d;
    --haayal-tip-text:           #ffffff;
    --haayal-tip-gradient:       linear-gradient(145deg, #73d13d 0%, #52c41a 70%, #3aad00 100%);
}

/* Vivid mode: white UI icons for dark-bg note types */
body.haayal-notes-vivid-colors .haayal-notes-inline-open_info,
body.haayal-notes-vivid-colors .haayal-notes-inline-open_warning,
body.haayal-notes-vivid-colors .haayal-notes-inline-open_tip,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_warning,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_tip,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_info {
    --haayal-kebab-color:     #ffffff;
    --haayal-drag-grip-color: #ffffff;
}

/* Vivid red/blue: light text in sticky creation form */
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_warning.haayal-notes-sticky-creation .haayal-notes-comment-private-row,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_info.haayal-notes-sticky-creation    .haayal-notes-comment-private-row,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_tip.haayal-notes-sticky-creation    .haayal-notes-comment-private-row {
    color: rgba(255, 255, 255, 0.9);
}
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_warning.haayal-notes-sticky-creation .haayal-notes-private-note,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_info.haayal-notes-sticky-creation    .haayal-notes-private-note,
body.haayal-notes-vivid-colors .haayal-notes-sticky-sticky_tip.haayal-notes-sticky-creation    .haayal-notes-private-note {
    color: rgba(255, 255, 255, 0.65);
}

/* Accessibility: focus-visible outlines */
.haayal-notes-kebab-trigger:focus-visible,
.haayal-notes-kebab-item:focus-visible,
.haayal-notes-marker:focus-visible,
.haayal-notes-fab-menu-item:focus-visible,
.haayal-notes-btn:focus-visible,
.haayal-notes-popover-close:focus-visible {
    outline: 2px solid #000;
}

/* Reset dashicons inside our UI so WP admin selectors cannot override size/float */
.haayal-notes-fab .dashicons,
.haayal-notes-popover .dashicons,
.haayal-notes-inline-banner .dashicons,
.haayal-notes-fallback-area .dashicons {
    float: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    font-size: inherit;
    line-height: inherit;
}

.haayal-notes-fab .dashicons:before,
.haayal-notes-popover .dashicons:before,
.haayal-notes-inline-banner .dashicons:before,
.haayal-notes-fallback-area .dashicons:before {
    padding: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    font-size: inherit !important;
    color: inherit !important;
}

/* FAB - Floating Action Button */
.haayal-notes-fab {
    position: fixed;
    bottom: 3vh;
    right: 2vw;
    z-index: 99999;
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
}

.haayal-notes-fab-grip {
    cursor: grab;
    font-size: 18px;
    color: #888;
    line-height: 1;
    padding: 4px 2px;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.haayal-notes-fab-grip:hover {
    opacity: 1;
}

.haayal-notes-fab-dragging {
    opacity: 0.85;
}

.haayal-notes-fab-dragging .haayal-notes-fab-grip {
    cursor: grabbing;
}

.haayal-notes-fab-btn {
    height: 40px;
    border-radius: 20px;
    border: none;
    background: var(--haayal-notes-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    letter-spacing: -0.01em;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.haayal-notes-fab-btn .haayal-notes-fab-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    font-weight: 300;
    margin: 0 -2px 0 -4px;
}

.haayal-notes-fab-btn:hover {
    background: var(--haayal-notes-brand-hover);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.15),
        0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.haayal-notes-fab-pulse {
    animation: haayalFabPulse 0.6s ease-in-out 2;
}

@keyframes haayalFabPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.haayal-notes-fab-btn.active {
    background: #ff453a;
}

.haayal-notes-fab-btn.active:hover {
    background: #ff6961;
}

.haayal-notes-visibility-btn {
    height: 32px;
    border-radius: 16px;
    border: none;
    background: rgb(255 255 255 / 60%);
    color: #3a3a3c;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow:
        0 0.5px 2px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 8em;
    gap: 5px;
    padding: 0 12px;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.haayal-notes-visibility-btn .haayal-notes-vis-icon {
    font-size: 14px;
    line-height: 1;
}

.haayal-notes-visibility-btn:hover {
    background: rgba(60,60,67,0.15);
    box-shadow:
        0 1px 3px rgba(0,0,0,0.1),
        0 4px 12px rgba(0,0,0,0.08);
}

.haayal-notes-visibility-btn.hidden {
}

/* Pulse animation when visibility auto-toggles on note publish */
@keyframes haayalVisPulse {
    0%   { transform: scale(1);    background: rgb(255 255 255 / 60%); box-shadow: 0 0 0 0 rgba(34,113,177,0.6); }
    15%  { transform: scale(1.25); background: rgba(34,113,177,0.2);   box-shadow: 0 0 0 6px rgba(34,113,177,0.4); }
    30%  { transform: scale(0.95); background: rgb(255 255 255 / 60%); box-shadow: 0 0 0 12px rgba(34,113,177,0); }
    45%  { transform: scale(1.18); background: rgba(34,113,177,0.15);  box-shadow: 0 0 0 4px rgba(34,113,177,0.35); }
    60%  { transform: scale(0.97); background: rgb(255 255 255 / 60%); box-shadow: 0 0 0 10px rgba(34,113,177,0); }
    75%  { transform: scale(1.1);  background: rgba(34,113,177,0.1);   box-shadow: 0 0 0 2px rgba(34,113,177,0.25); }
    100% { transform: scale(1);    background: rgb(255 255 255 / 60%); box-shadow: 0 0.5px 2px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06); }
}
.haayal-notes-visibility-btn.haayal-notes-vis-pulse {
    animation: haayalVisPulse 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* FAB sub-menu */
.haayal-notes-fab-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 4px 0;
    min-width: 180px;
    z-index: 100000;
    display: none;
}

.rtl .haayal-notes-fab-menu {
    right: 0;
    left: unset;
}

.haayal-notes-fab-menu.visible {
    display: block;
}

.haayal-notes-fab-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.haayal-notes-fab-menu-item:hover {
    background: #f0f0f1;
}

.haayal-notes-fab-menu-item-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

/* Placement mode */
body.haayal-notes-placement-mode {
    cursor: crosshair !important;
}

body.haayal-notes-placement-mode * {
    cursor: crosshair !important;
}

.haayal-notes-highlight-outline {
    outline: 2px dashed var(--haayal-notes-brand) !important;
    outline-offset: 2px;
}

/* Placement line indicator (between-elements insertion line) */
.haayal-notes-placement-line {
    position: fixed;
    background: var(--haayal-notes-brand);
    z-index: 99999;
    pointer-events: none;
    border-radius: 2px;
    transition: none;
}

.haayal-notes-placement-line.is-horizontal {
    height: 3px;
}

.haayal-notes-placement-line.is-vertical {
    width: 3px;
}

.haayal-notes-placement-banner {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 10px;
    background: var(--haayal-notes-brand);
    color: #fff;
    text-align: center;
    padding: 8px 26px;
    z-index: 100000;
    font-size: 13px;
}

.haayal-notes-placement-banner .haayal-notes-placement-esc {
    margin-inline-start: 12px;
    opacity: 0.8;
    font-size: 12px;
}

/* Comment markers */
.haayal-notes-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--haayal-notes-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.15s;
    line-height: 1;
    border: 2px solid #fff;
}

div.haayal-notes-marker span.dashicons.dashicons-admin-comments,
div.haayal-notes-marker span.dashicons.dashicons-location {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    color: inherit;
    padding: 0;
}

div.haayal-notes-marker span.dashicons.dashicons-admin-comments::before,
div.haayal-notes-marker span.dashicons.dashicons-location::before {
    background-color: unset;
    font-size: inherit;
    padding: 0;
    box-shadow: none;
    color: inherit;
}

.haayal-notes-marker:hover {
    transform: scale(1.2);
}

/* Override WP admin bar wildcard reset */
#wpadminbar .haayal-notes-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: var(--haayal-notes-brand);
    color: #fff;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-shadow: none;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    box-sizing: border-box;
    transition: transform 0.15s;
    border: 2px solid #fff;
}

#wpadminbar .haayal-notes-marker:hover {
    transform: scale(1.2);
}

/* Admin bar Notes menu item */
#wpadminbar .quicklinks #wp-admin-bar-haayal-notes > .ab-item {
    display: flex;
    align-items: center;
    flex-direction: row;
}

#wpadminbar>#wp-toolbar>#wp-admin-bar-root-default #wp-admin-bar-haayal-notes .dashicons-sticky {
    font-size: 16px;
}

.haayal-notes-marker-dragging {
    cursor: grabbing !important;
    transform: scale(1.3) !important;
    opacity: 0.85;
    z-index: 10000;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

@keyframes haayal-marker-bang {
    0%   { scale: 1;    rotate: 0deg;   opacity: 1; filter: none; }
    15%  { scale: 1.35; rotate: -35deg;  opacity: 1; filter: brightness(2) saturate(0.4); }
    30%  { scale: 0.8;  rotate: 14deg;   opacity: 0.9; filter: none; }
    45%  { scale: 0.4;  rotate: -22deg;  opacity: 0.7; }
    60%  { scale: 0.2;  rotate: 6deg;   opacity: 0.5; }
    100% { scale: 0;    rotate: 0deg;   opacity: 0; filter: none; }
}
.haayal-notes-marker-bang {
    animation: haayal-marker-bang 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
    transform-origin: center center;
    pointer-events: none !important;
    transition: none !important;
    z-index: 10001 !important;
}

/* Popover */
.haayal-notes-popover {
    position: absolute;
    z-index: 100001;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    width: 380px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.haayal-notes-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f6f7f7;
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.haayal-notes-popover-header-title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.haayal-notes-popover-header-title {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
}

.haayal-notes-popover-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #50575e;
    padding: 0;
    line-height: 1;
}

.haayal-notes-popover-close:hover {
    color: #d63638;
}

.haayal-notes-popover-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Thread */
.haayal-notes-thread-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.haayal-notes-thread-reply {
}

.haayal-notes-thread-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.haayal-notes-thread-author {
    font-weight: 600;
    color: var(--haayal-notes-brand);
    font-size: 12px;
}

.haayal-notes-thread-date {
    color: #8c8f94;
    font-size: 11px;
}

.haayal-notes-thread-content {
    color: #1d2327;
    line-height: 1.5;
    word-break: break-word;
}

.haayal-notes-thread-actions {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    flex-direction: row;
    justify-content: space-between;
}

.haayal-notes-thread-actions button {
    background: none;
    border: none;
    color: var(--haayal-notes-brand);
    cursor: pointer;
    font-size: 11px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.haayal-notes-thread-actions button .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    line-height: 13px;
}

.haayal-notes-thread-actions button:hover {
    color: var(--haayal-notes-brand-hover);
    text-decoration: underline;
}

.haayal-notes-thread-actions .haayal-notes-btn-delete {
    color: #d63638;
}

.haayal-notes-thread-actions .haayal-notes-btn-delete:hover {
    color: #b32d2e;
}

/* Kebab (3-dots) menu */
.haayal-notes-kebab-trigger {
    cursor: pointer;
    color: var(--haayal-kebab-color);
    display: inline-flex;
    align-items: center;
    padding: 0 2px;
    border-radius: 3px;
}

.haayal-notes-kebab-trigger .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.haayal-notes-kebab-trigger:hover {
    color: #1d2327;
    background: rgba(0,0,0,0.05);
}

.haayal-notes-kebab-menu {
    display: none;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    min-width: 120px;
    padding: 4px 0;
}

.haayal-notes-kebab-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #1d2327;
    cursor: pointer;
    white-space: nowrap;
}

.haayal-notes-kebab-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

.haayal-notes-kebab-item:hover {
    background: #f0f0f1;
}

.haayal-notes-kebab-item-danger {
    color: #d63638;
}

.haayal-notes-kebab-item-danger:hover {
    background: #fef2f2;
}

/* Inline banner kebab overrides */
.haayal-notes-inline-banner-actions .haayal-notes-kebab-trigger {
    opacity: 0.8;
    transition: opacity 0.15s;
}

.haayal-notes-inline-banner-actions .haayal-notes-kebab-trigger:hover {
    opacity: 1;
}

/* Inline edit form */
.haayal-notes-edit-form {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.haayal-notes-edit-form .haayal-notes-editor-area {
    min-height: 50px;
}

/* Rich editor */
.haayal-notes-rich-editor {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow: hidden;
}

.haayal-notes-rich-editor:focus-within {
    border-color: var(--haayal-notes-brand);
    box-shadow: 0 0 0 1px var(--haayal-notes-brand);
}

.haayal-notes-editor-toolbar-floating {
    position: absolute;
    z-index: 100050;
    display: none;
    gap: 2px;
    padding: 4px 6px;
    background: #1d2327;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.haayal-notes-editor-toolbar-floating .haayal-notes-toolbar-btn {
    color: #fff;
}

.haayal-notes-editor-toolbar-floating .haayal-notes-toolbar-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: transparent;
}

.haayal-notes-editor-toolbar-floating .haayal-notes-toolbar-color-btn {
    border-bottom-color: #d63638;
}

.haayal-notes-toolbar-visible {
    display: flex;
}

.haayal-notes-toolbar-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 13px;
    color: #1d2327;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
}

.haayal-notes-toolbar-btn:hover {
    background: #e0e0e0;
    border-color: #c3c4c7;
}

.haayal-notes-toolbar-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.haayal-notes-toolbar-color-wrap {
    position: relative;
}

.haayal-notes-toolbar-color-btn {
    font-weight: 700;
    border-bottom: 3px solid #d63638;
    padding-bottom: 0;
}

.haayal-notes-color-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px;
    gap: 4px;
    z-index: 10;
    flex-wrap: wrap;
    width: 140px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.haayal-notes-dropdown-visible {
    display: flex;
}

.haayal-notes-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 0 0 1px #c3c4c7;
    padding: 0;
}

.haayal-notes-color-swatch:hover {
    box-shadow: 0 0 0 2px var(--haayal-notes-brand);
}

.haayal-notes-editor-area {
    min-height: 60px;
    padding: 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    overflow-y: auto;
    word-break: break-word;
    text-align: left;
}

.haayal-notes-sticky .haayal-notes-editor-area {
    min-height: 120px;
}

html[dir="rtl"] .haayal-notes-editor-area {
    text-align: right;
}

.haayal-notes-editor-area:empty::before {
    content: attr(data-placeholder);
    color: #8c8f94;
    pointer-events: none;
}

.haayal-notes-editor-area a {
    color: var(--haayal-notes-brand);
    text-decoration: underline;
}

/* Link modal */
.haayal-notes-link-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.haayal-notes-link-modal {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.haayal-notes-link-modal h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #1d2327;
}

.haayal-notes-link-modal-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.haayal-notes-link-modal-input:focus {
    border-color: var(--haayal-notes-brand);
    box-shadow: 0 0 0 1px var(--haayal-notes-brand);
    outline: none;
}

.haayal-notes-link-modal-newtab {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

.haayal-notes-link-modal-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* @ Mention dropdown */
.haayal-notes-mention-dropdown {
    position: absolute;
    z-index: 100060;
    display: none;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 180px;
    overflow-y: auto;
    min-width: 180px;
}

.haayal-notes-mention-visible {
    display: block;
}

.haayal-notes-mention-item {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #1d2327;
}

.haayal-notes-mention-item:hover,
.haayal-notes-mention-active {
    background: #f0f6fc;
    color: var(--haayal-notes-brand);
}

/* Mention chips in editor */
.haayal-notes-mention-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e7f1f9;
    border: 1px solid var(--haayal-notes-brand);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 12px;
    color: var(--haayal-notes-brand);
    font-weight: 500;
    line-height: 1.7;
    vertical-align: baseline;
    user-select: none;
}

.haayal-notes-mention-chip-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    margin-left: 2px;
}

.haayal-notes-mention-chip-remove:hover {
    opacity: 1;
    color: #d63638;
}

/* Mention display in rendered comments */
.haayal-notes-thread-content .haayal-notes-mention-chip,
.haayal-notes-inline-banner-text .haayal-notes-mention-chip {
    padding: 0 6px;
    font-size: 12px;
}

.haayal-notes-thread-content .haayal-notes-mention-chip .haayal-notes-mention-chip-remove,
.haayal-notes-inline-banner-text .haayal-notes-mention-chip .haayal-notes-mention-chip-remove {
    display: none;
}

/* Comment form */
.haayal-notes-comment-form {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.haayal-notes-form-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Rich content display */
.haayal-notes-thread-content a {
    color: var(--haayal-notes-brand);
    text-decoration: underline;
}

.haayal-notes-inline-banner-text a {
    color: inherit;
    text-decoration: underline;
}

.haayal-notes-comment-form-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Banner display option icon buttons */
.haayal-notes-banner-icon-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #fff;
    color: #646970;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

.haayal-notes-banner-icon-btn + .haayal-notes-banner-icon-btn {
    margin-left: 1px;
}

.haayal-notes-banner-icon-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.haayal-notes-banner-svg {
    width: 12px;
    height: 12px;
}

.haayal-notes-banner-icon-btn:hover {
    border-color: #8c8f94;
    color: #1d2327;
}

.haayal-notes-btn {
    padding: 6px 16px;
    border-radius: 26px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid;
    line-height: 1.5;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.haayal-notes-btn-primary {
    background: var(--haayal-notes-brand);
    border-color: var(--haayal-notes-brand);
    color: #fff;
}

.haayal-notes-btn-primary:hover {
    background: var(--haayal-notes-brand-hover);
    box-shadow: 0 1px 4px rgba(79,34,177,0.3);
    transform: translateY(-0.5px);
}

.haayal-notes-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.haayal-notes-btn-secondary {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #50575e;
}

.haayal-notes-btn-secondary:hover {
    background: #e8e8e8;
    border-color: #8c8f94;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transform: translateY(-0.5px);
}

/* Fallback area */
.haayal-notes-fallback-area {
    background: #fff8e5;
    border: 1px solid #dba617;
    border-radius: 4px;
    margin: 12px 0;
    padding: 0;
}

.haayal-notes-fallback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
}

.haayal-notes-fallback-header:hover {
    background: #fff3cd;
}

.haayal-notes-fallback-header:focus-visible {
    outline: 2px solid;
}

.haayal-notes-fallback-title {
    font-weight: 600;
    color: #996800;
    font-size: 13px;
}

.haayal-notes-fallback-toggle {
    color: #996800;
    font-size: 16px;
    transition: transform 0.3s ease-in;
    transform: rotate(90deg);
}

.haayal-notes-fallback-toggle.expanded {
    transform: rotate(-90deg);
}

.haayal-notes-fallback-list {
    padding: 0 12px 12px;
    display: none;
}

.haayal-notes-fallback-list.visible {
    display: block;
}

.haayal-notes-fallback-item {
    padding: 8px 0;
    border-top: 1px solid #f0e6c8;
}
.haayal-notes-fallback-relocate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-top: 4px;
    font-size: 12px;
    color: #2271b1;
    cursor: pointer;
    border-radius: 4px;
}
.haayal-notes-fallback-relocate:hover {
    background: #f0f0f1;
}
.haayal-notes-fallback-relocate:focus-visible {
    outline: 2px solid;
}
.haayal-notes-fallback-relocate .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Orphaned badge */
.haayal-notes-orphaned-badge,
.haayal-notes-private-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-inline-start: 6px;
    vertical-align: middle;
}

.haayal-notes-orphaned-badge {
    background: #fff8e5;
    color: #996800;
    border: 1px solid #dba617;
    cursor: pointer;
    font-family: inherit;
    gap: 4px;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s, border-color 0.15s;
}

.haayal-notes-orphaned-badge:hover {
    background: #fff3cc;
    border-color: #c4920f;
}

.haayal-notes-orphaned-badge-icon {
    font-style: normal;
    font-size: 11px;
    line-height: 1;
    opacity: 0.8;
}

/* Generic modal */
.haayal-notes-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: haayal-notes-modal-fade-in 0.15s ease;
}

@keyframes haayal-notes-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.haayal-notes-modal-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    width: 90%;
    max-width: 380px;
    animation: haayal-notes-modal-slide-in 0.15s ease;
}

.haayal-notes-modal-card--wide {
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes haayal-notes-modal-slide-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header (title modals) */
.haayal-notes-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.haayal-notes-modal-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.3;
}

.haayal-notes-modal-x {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
    padding: 0 2px;
    margin-left: 12px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.haayal-notes-modal-x:hover { color: #d63638; }

.haayal-notes-modal-x:focus-visible {
    outline: 2px solid var(--haayal-notes-brand);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Body */
.haayal-notes-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #3c434a;
}

.haayal-notes-modal-body p {
    margin: 0 0 12px;
}

/* Confirm-style: simple message */
.haayal-notes-modal-message {
    font-size: 14px;
    color: #1d2327;
    line-height: 1.5;
    padding: 24px 28px 20px;
}

/* Info modal content elements */
.haayal-notes-modal-subheading {
    font-weight: 600;
    color: #1d2327;
    margin-top: 16px !important;
}

.haayal-notes-modal-reasons {
    margin: 0 0 4px;
    padding-left: 18px;
}

.haayal-notes-modal-reason {
    margin-bottom: 14px;
}

.haayal-notes-modal-reason strong {
    display: block;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 3px;
}

.haayal-notes-modal-reason p {
    margin: 0 0 4px;
    color: #50575e;
}

.haayal-notes-modal-reason-fix {
    font-size: 12px;
    color: #996800;
    font-style: italic;
    margin: 0 !important;
}

/* Actions row */
.haayal-notes-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 28px 20px;
}

.haayal-notes-private-badge {
    background: #f0f0f1;
    color: #50575e;
    border: 1px solid #c3c4c7;
}

/* Comment type selector */
.haayal-notes-comment-type-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.haayal-notes-comment-type-label {
    font-size: 12px;
    color: #8c8f94;
    margin-right: 2px;
}

.haayal-notes-type-opt {
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #c3c4c7;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    color: #50575e;
    transition: all 0.15s;
}

.haayal-notes-type-opt:hover {
    border-color: #8c8f94;
}

.haayal-notes-type-opt.active {
    background: #2c3338;
    border-color: #2c3338;
    color: #fff;
}

.haayal-notes-type-opt-alert.active,
.haayal-notes-type-opt-open_warning.active {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.haayal-notes-type-opt-attention.active,
.haayal-notes-type-opt-open_tip.active {
    background: #00a32a;
    border-color: #00a32a;
    color: #fff;
}

.haayal-notes-type-opt-open_important.active {
    background: #dba617;
    border-color: #dba617;
    color: #fff;
}

.haayal-notes-type-opt-open_info.active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* Open note color selector */
.haayal-notes-color-selector-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.haayal-notes-color-selector-swatch {
    border-radius: 12px;
    border: 1px solid #c3c4c7;
    cursor: pointer;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    background: #fff;
    transition: all 0.15s;
    white-space: nowrap;
}

/* Swatch type colors — open and sticky share the same palette */
.haayal-notes-swatch-open_warning,
.haayal-notes-swatch-sticky_warning   { color: var(--haayal-warning-border);   border-color: var(--haayal-warning-border); }
.haayal-notes-swatch-open_important,
.haayal-notes-swatch-sticky_important { color: var(--haayal-important-border); border-color: var(--haayal-important-border); }
.haayal-notes-swatch-open_info,
.haayal-notes-swatch-sticky_info      { color: var(--haayal-info-border);      border-color: var(--haayal-info-border); }
.haayal-notes-swatch-open_tip,
.haayal-notes-swatch-sticky_tip       { color: var(--haayal-tip-border);       border-color: var(--haayal-tip-border); }

.haayal-notes-color-selector-swatch:hover {
    opacity: 0.85;
}

.haayal-notes-swatch-open_warning.active,
.haayal-notes-swatch-sticky_warning.active   { background: var(--haayal-warning-border);   border-color: var(--haayal-warning-border);   color: #fff; }
.haayal-notes-swatch-open_important.active,
.haayal-notes-swatch-sticky_important.active { background: var(--haayal-important-border); border-color: var(--haayal-important-border); color: #fff; }
.haayal-notes-swatch-open_info.active,
.haayal-notes-swatch-sticky_info.active      { background: var(--haayal-info-border);      border-color: var(--haayal-info-border);      color: #fff; }
.haayal-notes-swatch-open_tip.active,
.haayal-notes-swatch-sticky_tip.active       { background: var(--haayal-tip-border);       border-color: var(--haayal-tip-border);       color: #fff; }

.haayal-notes-color-selector-swatch.active .haayal-notes-color-selector-icon {
    color: #fff;
}

.haayal-notes-color-selector-icon {
    font-size: 12px;
    line-height: 1;
}

/* Scope selector row */
.haayal-notes-comment-scope-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.haayal-notes-comment-scope-label {
    font-size: 12px;
    color: #8c8f94;
    margin-right: 2px;
}

.haayal-notes-scope-opt {
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid #c3c4c7;
    background: #fff;
    font-size: 11px;
    cursor: pointer;
    color: #50575e;
}

.haayal-notes-scope-opt:hover {
    border-color: #8c8f94;
}

.haayal-notes-scope-opt.active {
    background: #2c3338;
    border-color: #2c3338;
    color: #fff;
}

/* Private checkbox row */
.haayal-notes-comment-private-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    cursor: pointer;
    font-size: 12px;
    color: #50575e;
}

.haayal-notes-comment-private-row input[type="checkbox"] {
    margin: 0;
}

.haayal-notes-private-label {
    font-weight: 500;
}

.haayal-notes-private-note {
    color: #8c8f94;
    font-style: italic;
    font-size: 11px;
}

/* Private/mention mutual exclusion hints */
.haayal-notes-private-hint,
.haayal-notes-mention-hint {
    display: none;
    font-size: 11px;
    font-style: italic;
    color: #646970;
}

.haayal-notes-private-has-tags > .haayal-notes-private-hint {
    display: inline;
}

.haayal-notes-private-has-tags > .haayal-notes-private-note {
    display: none;
}

.haayal-notes-private-checked > .haayal-notes-mention-hint {
    display: inline;
}

.haayal-notes-private-checked > .haayal-notes-private-note {
    display: none;
}

.haayal-notes-comment-private-row input[type="checkbox"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.haayal-notes-private-has-tags {
    cursor: default;
}

/* Type badges in threads */
.haayal-notes-type-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.haayal-notes-type-alert,
.haayal-notes-type-open_warning {
    background: #fef2f2;
    color: #d63638;
    border: 1px solid #d63638;
}

.haayal-notes-type-attention,
.haayal-notes-type-open_tip {
    background: #edfaef;
    color: #00a32a;
    border: 1px solid #00a32a;
}

.haayal-notes-type-open_important {
    background: #fff8e5;
    color: #dba617;
    border: 1px solid #dba617;
}

.haayal-notes-type-open_info {
    background: #f0f6fc;
    color: #2271b1;
    border: 1px solid #2271b1;
}

/* Thread item type styling */
.haayal-notes-thread-alert,
.haayal-notes-thread-open_warning {
    border-left: 3px solid #d63638;
    padding-left: 8px;
}

.haayal-notes-thread-attention,
.haayal-notes-thread-open_tip {
    border-left: 3px solid #00a32a;
    padding-left: 8px;
}

.haayal-notes-thread-open_important {
    border-left: 3px solid #dba617;
    padding-left: 8px;
}

.haayal-notes-thread-open_info {
    border-left: 3px solid #2271b1;
    padding-left: 8px;
}

/* Inline banners for alert/attention (always visible) */
.haayal-notes-inline-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.5;
    animation: haayal-notes-banner-in 0.3s ease;
}

@keyframes haayal-notes-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Warning type — inline banner + sticky */
.haayal-notes-inline-alert,
.haayal-notes-inline-open_warning,
.haayal-notes-sticky-sticky_warning {
    border-color: var(--haayal-warning-border);
    color: var(--haayal-warning-text);
}
.haayal-notes-inline-alert,
.haayal-notes-inline-open_warning { background: var(--haayal-warning-bg); }

/* Important type */
.haayal-notes-inline-open_important,
.haayal-notes-sticky-sticky_important {
    border-color: var(--haayal-important-border);
    color: var(--haayal-important-text);
}
.haayal-notes-inline-open_important { background: var(--haayal-important-bg); }

/* Info type */
.haayal-notes-inline-open_info,
.haayal-notes-sticky-sticky_info {
    border-color: var(--haayal-info-border);
    color: var(--haayal-info-text);
}
.haayal-notes-inline-open_info { background: var(--haayal-info-bg); }

/* Tip type */
.haayal-notes-inline-attention,
.haayal-notes-inline-open_tip,
.haayal-notes-sticky-sticky_tip {
    border-color: var(--haayal-tip-border);
    color: var(--haayal-tip-text);
}
.haayal-notes-inline-attention,
.haayal-notes-inline-open_tip { background: var(--haayal-tip-bg); }

/* Compact banner layout */
.haayal-notes-inline-banner-compact {
    display: inline-flex;
    width: auto;
    max-width: 100%;
}

.haayal-notes-inline-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

.haayal-notes-inline-banner-icon {
    font-size: 16px;
    line-height: 1.3;
    flex-shrink: 0;
}

.haayal-notes-inline-banner-text {
    flex: 1;
}
.haayal-notes-inline-banner-text:not(:has(.haayal-notes-rich-editor)) {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.haayal-notes-inline-banner-author {
    color: inherit;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    --haayal-notes-element-opacity: 0.7;
    transition: opacity 0.3s ease;
}

.haayal-notes-inline-banner:not(:has(.haayal-notes-rich-editor)) .haayal-notes-private-badge {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.haayal-notes-inline-banner:is(:hover,:focus-within) .haayal-notes-inline-banner-author,
.haayal-notes-inline-banner:is(:hover,:focus-within) .haayal-notes-private-badge {
    opacity: 1;
}
.haayal-notes-inline-banner:is(:hover,:focus-within) .haayal-notes-inline-banner-author,
.haayal-notes-inline-banner:is(:hover,:focus-within) .haayal-notes-private-badge {
    opacity: var(--haayal-notes-element-opacity, 1);
}

.haayal-notes-inline-banner-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

.haayal-notes-inline-banner-action {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    color: inherit;
    opacity: 0.4;
    padding: 2px 6px;
    line-height: 1;
    transition: opacity 0.15s;
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.haayal-notes-inline-banner-action .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

.haayal-notes-inline-banner-action:hover {
    opacity: 1;
}
.haayal-notes-inline-banner-action:focus-visible {
    outline: 2px solid;
}

:is(.haayal-notes-inline-banner-text, .haayal-notes-sticky-body, .haayal-notes-sticky-creation) .haayal-notes-rich-editor {
    margin-top: 4px;
    background: rgba(255,255,255,0.8);
    color: #1d2327;
}

.haayal-notes-inline-banner-text .haayal-notes-editor-area {
    min-height: 40px;
}

.haayal-notes-inline-edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.haayal-notes-inline-edit-btn-group {
    display: flex;
    gap: 6px;
    margin-inline-start: auto;
}

/* Drag grip for relocating */
.haayal-notes-drag-grip {
    cursor: grab;
    color: var(--haayal-drag-grip-color);
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    user-select: none;
    letter-spacing: -6px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.haayal-notes-drag-grip:hover {
    color: var(--haayal-notes-brand);
    background: rgba(79,34,177,0.08);
}

.haayal-notes-drag-grip:active {
    cursor: grabbing;
}

.haayal-notes-inline-banner .haayal-notes-drag-grip {
    align-self: flex-start;
    margin-top: 3px;
    margin-right: 4px;
}

/* Confirm dialog — aliases to generic modal */
.haayal-notes-confirm-overlay { display: none; } /* unused — now uses .haayal-notes-modal-overlay */

.haayal-notes-btn-danger {
    background: #d63638;
    border-color: #d63638;
    color: #fff;
}

.haayal-notes-btn-danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
    box-shadow: 0 1px 4px rgba(214,54,56,0.3);
    transform: translateY(-0.5px);
}

/* Toast notification */
.haayal-notes-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1d2327;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 100010;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.haayal-notes-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Overlay for popover */
.haayal-notes-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: transparent;
}

/* ===== Sticky Notes ===== */

/* Shadow wrapper — filter: drop-shadow here sees the card's clipped pentagon shape */
.haayal-notes-sticky-wrap {
    position: absolute;
    z-index: 99990;
    transform: rotate(var(--haayal-sticky-rotation, 0deg));
    filter:
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12))
        drop-shadow(0 6px 20px rgba(0, 0, 0, 0.15));
}

.haayal-notes-sticky-wrap.haayal-notes-sticky-dragging {
    transform: rotate(var(--haayal-sticky-rotation, 0deg)) scale(0.97);
    filter: drop-shadow(6px 18px 7px rgba(0, 0, 0, 0.18));
    z-index: 99999;
}

.haayal-notes-sticky-wrap.haayal-notes-sticky-dragging .haayal-notes-sticky-header {
    cursor: grabbing;
}

.haayal-notes-sticky {
    position: absolute;
    left: 0;
    top: 0;
    width: 240px;
    height: 240px;
    border-radius: 2px 5px 4px 3px / 4px 2px 5px 3px;
    border-width: 1px;
    border-style: solid;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    animation: haayal-notes-sticky-in 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --sticky-fold-color: transparent;
    z-index: 99999;
}

.rtl .haayal-notes-sticky {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

/* Fold crease — gradient perpendicular to the 45° cut; border-color stripe shows paper edge */
.haayal-notes-sticky::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(
        134deg,
        rgba(0, 0, 0, 0.13) 49%,
        var(--sticky-fold-color) 50%,
        var(--sticky-fold-color) 58%,
        transparent 59%
    );
    pointer-events: none;
}

.rtl .haayal-notes-sticky::after {
    left: 0;
    right: unset;
    background: linear-gradient(225deg, rgba(0, 0, 0, 0.13) 49%, var(--sticky-fold-color) 50%, var(--sticky-fold-color) 52%, transparent 59%);
}

.haayal-notes-sticky-expanded {
    width: 320px;
    height: 320px;
}

@keyframes haayal-notes-sticky-in {
    from { opacity: 0; transform: scale(0.93); }
    to   { opacity: 1; transform: scale(1); }
}

.haayal-notes-sticky-sticky_warning {
    background: var(--haayal-warning-gradient);
    --sticky-fold-color: var(--haayal-warning-border);
}

.haayal-notes-sticky-sticky_important {
    background: var(--haayal-important-gradient);
    --sticky-fold-color: var(--haayal-important-border);
}

.haayal-notes-sticky-sticky_info {
    background: var(--haayal-info-gradient);
    --sticky-fold-color: var(--haayal-info-border);
}

.haayal-notes-sticky-sticky_tip {
    background: var(--haayal-tip-gradient);
    --sticky-fold-color: var(--haayal-tip-border);
}

.haayal-notes-sticky-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    gap: 6px;
    cursor: grab;
    user-select: none;
}

.haayal-notes-sticky-header .haayal-notes-sticky-header-actions {
    cursor: default;
}

.haayal-notes-sticky-header .haayal-notes-drag-grip {
    flex-shrink: 0;
    margin-top: 0;
}

.haayal-notes-sticky-type-icon {
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}

.haayal-notes-sticky-header-actions {
    display: flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.haayal-notes-sticky-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 6px;
    position: relative;
}

.haayal-notes-sticky-content {
    flex: 1;
    overflow: hidden;
    word-break: break-word;
    min-height: 0;
    font-family: 'Comic Neue', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
}

.haayal-notes-sticky-body.haayal-notes-sticky-body-overflow {
    cursor: pointer;
}

.haayal-notes-sticky-content p {
    margin: 0 0 4px;
}

.haayal-notes-sticky-content-clipped {
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.haayal-notes-sticky-overflow-btn {
    display: block;
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
    text-align: start;
}

.haayal-notes-sticky-overflow-btn::before { content: '... '; }
[dir="rtl"] .haayal-notes-sticky-overflow-btn::before { content: ''; }
[dir="rtl"] .haayal-notes-sticky-overflow-btn::after  { content: ' ...'; }

.haayal-notes-sticky-overflow-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.haayal-notes-sticky-meta {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.haayal-notes-sticky:hover .haayal-notes-sticky-meta {
    opacity: 0.8;
}

/* Private badge in sticky header: hidden until hover */
.haayal-notes-sticky-header .haayal-notes-private-badge {
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 10px;
    flex-shrink: 0;
}

.haayal-notes-sticky:hover .haayal-notes-sticky-header .haayal-notes-private-badge {
    opacity: 1;
}

/* Creation mode: expanded = 320×320; after transitionend JS sets height:auto */
.haayal-notes-sticky-creation.haayal-notes-sticky-expanded {
    overflow: visible;
}

.haayal-notes-sticky-creation .haayal-notes-comment-form {
    margin-top: 0;
    flex: 1;
    overflow: hidden;
    padding: 10px 12px 6px;
    position: relative;
}

.haayal-notes-sticky-creation .haayal-notes-editor-area {
    max-height: 150px;
    overflow-y: auto;
}


.haayal-notes-sticky-modal-content {
    margin-bottom: 12px;
}

.haayal-notes-sticky-modal-author {
    font-size: 11px;
    opacity: 0.7;
    margin: 0;
}


/* Dashicon resets inside sticky cards */
.haayal-notes-sticky .dashicons {
    float: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    font-size: inherit;
    line-height: inherit;
    vertical-align: middle;
}

.haayal-notes-sticky .dashicons:before {
    padding: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
