.main-content {
    padding: 16px;
    flex-direction: column;
}

.ContentEditable__root {
    height: calc(100vh - 182px) !important;
    height: calc(100dvh - 182px) !important;
}

.action-button.lock,
.action-button.share {
    display: none !important;
}

.action-button.upload-btn,
.action-button.download-btn {
    display: inline-flex;
}

.action-button.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

#root {
    .actions {
        width: 100%;
        bottom: 0 !important;
        display: flex;
        align-items: center;
        flex-direction: row-reverse;
        padding: 8px 16px;
        margin: 0 !important;
        z-index: 1;

        @media screen and (max-width:940px) {
            position: fixed;
            top: 100%;
            transform: translateY(-100%);
            left: 0;
            right: 0;
            bottom: unset !important;
        }
    }
}

.tool__section__wrapper {
    position: relative;
    flex: 1;
    display: flex;
    width: 100%;
    flex-direction: column;
}


:root.dark {

    .action-button>img,
    .action-button>i {
        filter: invert(1) brightness(0.8);
    }

    .action-button:hover {
        background-color: var(--gray-gradient);
    }

    .Modal__content>div>button:last-child {
        background-color: var(--bg-gray);

        &:hover {
            background-color: var(--color-light-bg);
        }
    }

    .dateTimePicker {
        background: var(--color-white);
        border-color: var(--color-gray-light);
    }

    .notes__view__container a.active {
        background-color: #1C1C1C;
    }

    .create__new__note:hover {
        box-shadow:
            0 2px 6px rgba(0, 0, 0, .6),
            /* depth */
            0 0 0 1px rgba(255, 255, 255, .08),
            /* edge contrast */
            0 0 12px rgba(45, 108, 223, .35);
        /* soft blue glow */
    }
}

.info-container {
    font-size: 14px;
    border-radius: 10px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: start;

    .upload-file {
        padding: 8px;
        border-radius: 6px;
        font-family: "Open Sans", sans-serif;
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
        color: var(--text-color);
        background-color: transparent;
        white-space: nowrap;
        display: inline-flex;
        gap: 2px;
        align-items: center;
        border: none;
        outline: none;
        cursor: pointer;
        text-align: center;

        img {
            filter: var(--filter-white);
        }

        &:hover {
            background-color: var(--hover-doc);
            color: var(--hover-text);

            img {
                filter: var(--filter-icon);
            }
        }
    }

    .info {
        color: var(--color-paragraph);
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    @media screen and (max-width: 768px) {
        bottom: 64px;
    }
}

.footer-tool-btns {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.saving__update__status__container {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.saving__update__status__container img {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


.saving__update__status__container span {
    color: var(--text-light);
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0px;
}


@media (width <=768px) {
    .d-md-none {
        display: none !important;
    }
}

@media screen and (max-width:940px) {
    .main-content {
        padding: 0;
    }

    .saving__update__status__container span {
        display: none;
    }

    .doc__title__wrapper {
        position: relative;
    }

    .saving__update__status__container {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 12px;
        z-index: 2;
    }


    .ContentEditable__root {
        height: calc(100vh - 214px) !important;
        height: calc(100dvh - 190px) !important;
    }

    #root {
        border-radius: 0 !important;
        min-height: calc(100vh - 117px);
        min-height: calc(100dvh - 117px);
    }

    .main-content {
        height: calc(100vh - 80px) !important;
        height: calc(100dvh - 80px) !important;
    }

    /* .ContentEditable__root {
        height: calc(100vh - 220px) !important;
    } */
}

#captchaId {
    position: fixed;
    bottom: 12px;
    right: 18px;
    z-index: 9999;
}

.ai-button {
    display: inline-flex;
    gap: 4px;
    position: absolute;
    top: 112px;
    left: 48px;
    border: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    color: var(--color-black);
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-light);
    padding: 8px 16px;
    border-radius: 2rem;
    box-shadow: 0px 2px 4px 0px #00000040;
    transition: all 0.2s ease;

    &:hover {
        box-shadow: 0px 4px 6px -1px #00000040;
        cursor: pointer;
    }

    @media (width <=1025px) {
        left: 22px;
    }

    @media (width <=768px) {
        top: 96px;
        left: 8px;
    }
}

/* ── Help-Me-Write popup ── */
.hmw-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 998;
}

.hmw-popup {
    position: absolute;
    top: 148px;
    left: 48px;
    width: 100%;
    max-width: 752px;
    background: var(--bg-white);
    border: 1px solid var(--color-gray-light);
    border-radius: 12px;
    box-shadow: 0 4px 6px 0 rgba(0, 0, 0, 0.25);
    z-index: 999;
    overflow: hidden;
    animation: hmwPopupIn 0.15s ease;
}

.hmw-popup[data-active-stage="result"] {
    border-color: var(--color-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
}

@keyframes hmwPopupIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hmw-stage {
    position: relative;
}

/* ── Stage: input ── */
.hmw-stage--input {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.hmw-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.hmw-sparkle {
    flex-shrink: 0;
    display: block;
}

.hmw-title {
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-black);
}

.hmw-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-black);
    padding: 0;
    transition: background 0.15s;
}

.hmw-close:hover {
    background: var(--hover-doc);
}

.hmw-head .hmw-close {
    position: absolute;
}

.hmw-input-row {
    width: 100%;
    padding-right: 28px;
}

.hmw-input {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: "Open Sans", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: var(--color-black);
    padding: 0;
    overflow: hidden;
}

.hmw-input::placeholder {
    color: var(--placeholder-text);
}

.hmw-foot {
    display: flex;
    align-items: center;
    width: 100%;
}

.hmw-foot--end {
    justify-content: flex-end;
}

.hmw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 6px 24px;
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.hmw-btn--primary {
    background: var(--color-black);
    color: var(--bg-white);
}

.hmw-btn--primary:hover:not(:disabled) {
    opacity: 0.85;
}

.hmw-btn--primary:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* ── Stage: skeleton ── */
.hmw-stage--skeleton {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 56px 16px 16px;
}

.hmw-skel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.hmw-skel-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.hmw-skel {
    background: linear-gradient(90deg, rgba(42, 153, 237, 0.15), rgba(2, 218, 197, 0.15));
    animation: hmwSkelPulse 1.4s ease-in-out infinite;
}

.hmw-skel--box {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
}

.hmw-skel--bar {
    height: 12px;
    border-radius: 999px;
}

.hmw-skel--flex {
    flex: 1 1 0;
    min-width: 0;
}

@keyframes hmwSkelPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

.hmw-close--absolute {
    position: absolute;
    top: 15px;
    right: 15px;
}

/* ── Stage: result ── */
.hmw-result-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--color-gray-light);
}

.hmw-result-title {
    flex: 1;
    min-width: 0;
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 24px;
}

.hmw-result-body {
    position: relative;
    padding: 16px 0 16px 16px;
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    line-height: 28px;
    color: var(--color-black);
}

.hmw-result-content {
    padding-right: 28px;
    max-height: min(300px, calc(100vh - 400px));
    overflow-y: auto;
}

.hmw-result-content>*:first-child {
    margin-top: 0;
}

.hmw-result-content>*:last-child {
    margin-bottom: 0;
}

.hmw-result-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: var(--color-darkgray, #555);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.hmw-result-delete:hover {
    color: var(--color-black, #000);
}

.hmw-result-body h1,
.hmw-result-body h2,
.hmw-result-body h3,
.hmw-result-body h4 {
    font-weight: 700;
    font-size: 20px;
    line-height: 32px;
    color: var(--color-black);
    margin: 16px 0 8px;
}

.hmw-result-body p {
    margin: 0 0 12px;
}

.hmw-result-body ul,
.hmw-result-body ol {
    margin: 0 0 12px;
    padding-left: 24px;
}

.hmw-result-body::-webkit-scrollbar {
    width: 4px;
}

.hmw-result-body::-webkit-scrollbar-track {
    background: transparent;
}

.hmw-result-body::-webkit-scrollbar-thumb {
    background: var(--color-gray-light);
    border-radius: 50px;
}

.hmw-result-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--color-gray-light);
}

.hmw-refine-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 1px solid var(--color-gray-light);
    border-radius: 999px;
    padding: 6px 10px;
    transition: border-color 0.15s;
}

.hmw-refine-input-wrap:focus-within {
    border-color: var(--color-primary);
}

.hmw-refine-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-black);
    padding: 0;
}

.hmw-refine-input::placeholder {
    color: var(--placeholder-text);
}

.hmw-refine-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hmw-refine-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--color-gray-light, #eceef0);
    color: var(--color-black, #111);
    cursor: pointer;
    transition: background-color 0.15s;
}

.hmw-refine-clear:hover {
    background: var(--color-gray-accent, #dfe2e4);
}

.hmw-refine-clear svg {
    display: block;
}

/* ── Mobile: fixed-center popup ── */
@media (max-width: 768px) {
    /* .hmw-backdrop {
        background: rgba(0, 0, 0, 0.4);
    } */

    .hmw-popup {
        top: 178px;
        left: 8px;
        right: auto;
        width: calc(100% - 32px);
        max-width: 520px;
        max-height: calc(100dvh - 64px);
        overflow: auto;
    }

    /* .hmw-result-body {
        max-height: 50dvh;
    } */

    .hmw-result-delete img,
    .hmw-result-delete svg {
        width: 18px;
        height: 18px;
    }
}

/* ── Dark theme ── */
:root.dark {
    .hmw-popup {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .hmw-skel {
        background: linear-gradient(90deg, rgba(42, 153, 237, 0.25), rgba(2, 218, 197, 0.25));
    }
}