#ax-annotation-root {
    position: fixed;
    z-index: 2147483647;
}

.ax-anno-btn {
    position: fixed;
    right: 24px;
    bottom: 140px; /* Above the comment button */
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #ffffff;
    border-radius: 12px;
    text-align: center;
    line-height: 44px;
    font-size: 0;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    user-select: none;
    z-index: 1000002;
}

.ax-anno-icon,
.ax-anno-close {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.ax-anno-icon {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12%2020h9%27/%3E%3Cpath%20d%3D%27M16.5%203.5a2.121%202.121%200%200%201%203%203L7%2019l-4%201%201-4Z%27/%3E%3Cpath%20d%3D%27m15%205%203%203%27/%3E%3C/svg%3E");
}

.ax-anno-close {
    background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%23ffffff%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M18%206%206%2018%27/%3E%3Cpath%20d%3D%27M6%206l12%2012%27/%3E%3C/svg%3E");
}

.ax-anno-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
    background-color: rgba(30, 41, 59, 0.92);
    border-color: rgba(148, 163, 184, 0.38);
}

.ax-anno-btn.active {
    background: rgba(185, 28, 28, 0.92);
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.ax-anno-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ax-anno-modal {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 320px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.ax-anno-modal h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #333;
}

.ax-anno-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.ax-anno-modal .btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ax-anno-modal button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ax-anno-modal .btn-cancel {
    background: #f1f1f1;
    color: #333;
}

.ax-anno-modal .btn-confirm {
    background: #ff9800;
    color: white;
}

.ax-anno-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 999999;
    cursor: crosshair;
}

.ax-anno-drawing {
    position: absolute;
    border: 2px dashed #ff9800;
    background: rgba(255, 152, 0, 0.2);
    pointer-events: none;
}

.ax-anno-box {
    position: absolute;
    border: 2px solid #ff9800;
    background: rgba(255, 152, 0, 0.1);
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s;
}

.ax-anno-box:hover {
    background: rgba(255, 152, 0, 0.3);
}

.ax-anno-box.selected {
    border-color: #d32f2f;
    background: rgba(211, 47, 47, 0.08);
}

.ax-anno-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border: 2px solid #d32f2f;
    border-radius: 2px;
    box-sizing: border-box;
    z-index: 11;
}

.ax-anno-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ax-anno-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ax-anno-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ax-anno-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }

.ax-anno-handle.n { left: 50%; top: -6px; transform: translateX(-50%); cursor: ns-resize; }
.ax-anno-handle.s { left: 50%; bottom: -6px; transform: translateX(-50%); cursor: ns-resize; }
.ax-anno-handle.w { left: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.ax-anno-handle.e { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

.ax-anno-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    padding: 12px;
    width: 240px;
    z-index: 1000000;
    font-family: sans-serif;
    font-size: 14px;
}

.ax-anno-tooltip-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.ax-anno-tooltip-author {
    font-weight: bold;
    color: #ff9800;
}

.ax-anno-tooltip-content {
    margin-bottom: 12px;
    color: #333;
    line-height: 1.5;
    word-wrap: break-word;
}

.ax-anno-tooltip textarea {
    width: 100%;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    box-sizing: border-box;
    margin-bottom: 8px;
    resize: vertical;
}

.ax-anno-tooltip .btns {
    display: flex;
    justify-content: space-between;
}

.ax-anno-tooltip button {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.ax-anno-tooltip .btn-save { background: #ff9800; color: white; }
.ax-anno-tooltip .btn-del { background: #f44336; color: white; }
.ax-anno-tooltip .btn-cancel { background: #eee; color: #333; }
