.fame-hl-scope {
    position: relative;
}

.fame-hl-scope .explanation-text {
    -webkit-user-select: text;
    user-select: text;
}

.fame-hl-scope .fame-hl {
    display: inline;
    cursor: pointer;
    transition: filter 120ms ease;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0;
    margin: 0;
    border: 0;
    line-height: inherit;
    white-space: inherit;
    word-break: inherit;
    overflow-wrap: inherit;
}

.fame-hl-scope .fame-hl.fame-fmt-color {
    border-radius: 2px;
    color: #ffffff;
}

.fame-hl-scope .fame-hl.fame-fmt-color * {
    color: inherit;
}

.fame-hl-scope .fame-hl:hover {
    filter: brightness(0.95);
}

.fame-hl-scope .fame-hl-swatch {
    position: absolute;
    display: none;
    z-index: 50;
    background: #fff;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    padding: 5px 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.fame-hl-scope .fame-hl-swatch.is-open {
    display: inline-flex;
}

.fame-hl-scope .fame-hl-swatch button {
    outline: none;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    cursor: pointer;
    margin: 0 3px;
    padding: 0;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-color:hover {
    transform: scale(1.12);
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-color.is-active {
    box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px #0f172a;
    transform: scale(1.12);
}

.fame-hl-scope .fame-hl-swatch .fame-hl-sep {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 6px;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt {
    min-width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    margin: 0 2px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt:hover {
    background: #e2e8f0;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt.is-active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt-is_bold {
    font-weight: 700;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt-is_underline {
    text-decoration: underline;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-fmt-is_strikethrough {
    text-decoration: line-through;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-note {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 4px;
    transition: background-color 120ms ease, transform 120ms ease;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-note:hover {
    background: #e0e7ff;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-note.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-note.is-saving {
    opacity: 0.6;
    cursor: progress;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-note.is-saved {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-delete {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid #fecaca;
    background: #fff1f1;
    color: #b91c1c;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 120ms ease;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-delete:hover {
    background: #fee2e2;
}

.fame-hl-scope .fame-hl.fame-hl-has-note {
    position: relative;
}

.fame-hl-scope .fame-hl-tooltip {
    position: absolute;
    z-index: 60;
    max-width: 320px;
    min-width: 180px;
    background: #0f172a;
    color: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.04);
    font-size: 12.5px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
    --fame-hl-tooltip-accent: #4f46e5;
    --fame-hl-tooltip-arrow-left: 16px;
    border-top: 3px solid var(--fame-hl-tooltip-accent);
}

.fame-hl-scope .fame-hl-tooltip.is-open {
    opacity: 1;
    transform: translateY(0);
}

.fame-hl-scope .fame-hl-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #0f172a;
    transform: rotate(45deg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    bottom: -6px;
    left: var(--fame-hl-tooltip-arrow-left);
    margin-left: -6px;
}

.fame-hl-scope .fame-hl-tooltip.is-below {
    border-top: 0;
    border-bottom: 3px solid var(--fame-hl-tooltip-accent);
}

.fame-hl-scope .fame-hl-tooltip.is-below .fame-hl-tooltip-arrow {
    top: -6px;
    bottom: auto;
}

.fame-hl-scope .fame-hl-tooltip-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(248, 250, 252, 0.08);
}

.fame-hl-scope .fame-hl-tooltip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fame-hl-tooltip-accent);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 1);
    flex: 0 0 auto;
}

.fame-hl-scope .fame-hl-tooltip-title {
    font-weight: 700;
    font-size: 13px;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fame-hl-scope .fame-hl-tooltip-body {
    color: #e2e8f0;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
}

.fame-hl-scope .fame-hl-tooltip-body p { margin: 0 0 6px 0; }
.fame-hl-scope .fame-hl-tooltip-body p:last-child { margin-bottom: 0; }
.fame-hl-scope .fame-hl-tooltip-body ul,
.fame-hl-scope .fame-hl-tooltip-body ol { margin: 0 0 6px 0; padding-left: 20px; }
.fame-hl-scope .fame-hl-tooltip-body strong { color: #ffffff; }
.fame-hl-scope .fame-hl-tooltip-body a { color: #93c5fd; text-decoration: underline; }

.fame-hl-scope .fame-hl.fame-hl-has-note::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4f46e5;
    box-shadow: 0 0 0 1.5px #ffffff;
    pointer-events: none;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-remove {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #b91c1c;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fame-hl-scope .fame-hl-swatch button.fame-hl-remove:hover {
    background: #fecaca;
}

.fame-hl-scope .fame-hl-note-editor {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
    padding: 12px;
    width: 320px;
    max-width: 92vw;
    z-index: 51;
    --fame-hl-note-accent: #4f46e5;
}

.fame-hl-scope .fame-hl-note-editor.is-open {
    display: block;
}

.fame-hl-scope .fame-hl-note-editor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    background: var(--fame-hl-note-accent);
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-title {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    color: #0f172a;
    background: #f8fafc;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-title:focus {
    border-color: var(--fame-hl-note-accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
    background: #ffffff;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte:focus-within {
    border-color: var(--fame-hl-note-accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
    background: #ffffff;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-wrap: wrap;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte-btn {
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 5px;
    color: #475569;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-rte-sep {
    width: 1px;
    height: 16px;
    background: #e2e8f0;
    margin: 0 4px;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-body {
    min-height: 88px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.5;
    outline: none;
    word-wrap: break-word;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-body:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-body p {
    margin: 0 0 6px 0;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-body ul,
.fame-hl-scope .fame-hl-note-editor .fame-hl-note-body ol {
    margin: 0 0 6px 0;
    padding-left: 22px;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-actions .fame-hl-note-status {
    margin-right: auto;
    font-size: 12px;
    color: #64748b;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-cancel,
.fame-hl-scope .fame-hl-note-editor .fame-hl-note-savebtn {
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: filter 120ms ease, background-color 120ms ease;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-cancel {
    background: transparent;
    color: #475569;
    border-color: transparent;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-cancel:hover {
    background: #f1f5f9;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-savebtn {
    background: var(--fame-hl-note-accent);
    color: #ffffff;
    border-color: var(--fame-hl-note-accent);
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-savebtn:hover:not(:disabled) {
    filter: brightness(0.92);
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-savebtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fame-hl-scope .fame-hl-note-editor .fame-hl-note-savebtn.is-saving {
    opacity: 0.7;
    cursor: progress;
}
