/* ==================================================================
   CATENOT.ES — DESIGN TOKENS
   Metáfora: uma árvore no escuro — o mundo é a terra à noite,
   as notas são folhas de papel que brotam dela.
   ================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Courier+Prime:wght@700&family=Manrope:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* Colors */
    --color-canvas: #11140F;
    --color-canvas-dot: #1D2318;
    --color-paper: #EDE4C8;
    --color-paper-dim: #D9CFAF;
    --color-ink: #26241A;
    --color-ink-soft: #56503D;
    --color-accent: #C08A3E;
    --color-accent-soft: #7C9473;
    --color-danger: #B5533D;
    --color-overlay-backdrop: rgba(8, 10, 6, 0.72);

    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    /* Layout */
    --note-height: 10vh;
    --note-width: 20vh;
    --radius-note: 14px;
    --radius-fab: 50%;

    color-scheme: dark;
}

[data-theme="light"] {
    --color-canvas: #EFE9DA;
    --color-canvas-dot: #DED5BE;
    --color-overlay-backdrop: rgba(60, 55, 40, 0.35);

    color-scheme: light;
}


/* ==================================================================
   GLOBAL
   ================================================================== */

* {
    box-sizing: border-box;
}

::selection {
    background: var(--color-ink);
    color: var(--color-paper);
}

::-moz-selection {
    background: var(--color-ink);
    color: var(--color-paper);
}

html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: var(--app-height, 100dvh);
    background: var(--color-canvas);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}


/* ==================================================================
   TOP BAR
   ================================================================== */

#topbar {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 20px;
    right: 20px;
    z-index: 50;

    display: flex;
    justify-content: space-between;
    align-items: center;

    pointer-events: none;
}

#site-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-family: 'Courier Prime', 'Courier New', monospace;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.06em;

    color: var(--color-paper);
    background: rgba(38, 36, 26, 0.55);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    padding: 10px 22px;
    border-radius: 999px;

    pointer-events: auto;
    user-select: none;
    white-space: nowrap;
}

#menu-toggle,
#theme-toggle {
    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    line-height: 1;

    background: rgba(38, 36, 26, 0.55);
    color: var(--color-paper);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    font-size: 16px;
    cursor: pointer;
    pointer-events: auto;

    transition: background 0.15s ease;
    flex-shrink: 0;
}

#menu-toggle:hover,
#theme-toggle:hover {
    background: rgba(38, 36, 26, 0.72);
}


/* ==================================================================
   MENU DROPDOWN
   ================================================================== */

.menu-dropdown {
    position: fixed;
    top: calc(max(16px, env(safe-area-inset-top)) + 46px);
    left: 20px;
    z-index: 60;

    min-width: 200px;
    padding: 6px;

    background: var(--color-paper);
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);

    opacity: 0;
    transform: translateY(-6px);

    pointer-events: none;

    transition:
        opacity 0.16s ease,
        transform 0.16s ease;
}

.menu-dropdown--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.menu-dropdown__item {
    display: block;
    width: 100%;

    padding: 10px 12px;

    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;

    color: var(--color-ink);
    text-align: left;
    text-decoration: none;

    border: none;
    border-radius: 8px;
    background: transparent;

    cursor: pointer;
    transition: background 0.15s ease;
}

.menu-dropdown__item:hover {
    background: rgba(38, 36, 26, 0.08);
}


/* ==================================================================
   CANVAS / WORLD
   ================================================================== */

#window {
    position: relative;

    width: 100dvw;
    height: var(--app-height, 100dvh);

    margin: 0;
    padding: 0;

    overflow: hidden;

    background-color: var(--color-canvas);
    background-image:
        radial-gradient(
            var(--color-canvas-dot) 1.5px,
            transparent 1.5px
        );
    background-size: 28px 28px;

    cursor: grab;
}

#window:active {
    cursor: grabbing;
}

#world {
    position: relative;

    width: 10000px;
    height: 10000px;

    transform-origin: 0 0;
}

#root-grid {
    position: absolute;

    top: 5000px;
    left: 5000px;

    transform: translate(-50%, -50%);

    width: 80vw;
    max-width: 900px;
}


/* ==================================================================
   NOTE GRID
   ================================================================== */

.note-grid {
    display: flex;
    flex-wrap: wrap;

    justify-content: center;
    align-content: center;
    align-items: center;

    gap: 3vh;
}

.note-grid--nested {
    position: static;

    width: 100%;
    height: calc(max(var(--note-height), 64px) + 72px);

    margin-top: 3vh;
    padding: 36px 28px;

    flex-wrap: nowrap;
    flex-shrink: 0;

    justify-content: flex-start;
    align-items: center;

    overflow-x: auto;
    overflow-y: hidden;

    background: rgba(38, 36, 26, 0.035);
    border-radius: 12px;
}

.note-grid--nested.note-grid--empty {
    display: none;
}


/* ==================================================================
   NOTE CARD
   Estado final — prioriza a versão adicionada posteriormente.
   ================================================================== */

.note {
    width: var(--note-width);
    height: var(--note-height);

    min-width: 140px;
    min-height: 72px;

    padding: 10px 14px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 4px;

    background: var(--color-paper);
    border-radius: var(--radius-note);

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 10px 18px rgba(0, 0, 0, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.25);

    cursor: pointer;
    user-select: none;
    touch-action: none;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.note:hover {
    transform: translateY(-2px);

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 14px 22px rgba(0, 0, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.3);
}

.note:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.note--dragging {
    cursor: grabbing;
    z-index: 50;

    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 22px 30px rgba(0, 0, 0, 0.5);
}

/* Notes that have a text preview get a taller 3:4 card so the preview
   has room to breathe, instead of the default squat 2:1 shape. */
.note--has-text {
    aspect-ratio: 3 / 4;
    width: var(--note-width);
    height: auto;
}


/* ==================================================================
   NOTE TITLE
   ================================================================== */

.note__title {
    width: 100%;
    margin: 0;

    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(13px, 1.6vh, 16px);

    color: var(--color-ink);
    text-align: center;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==================================================================
   NOTE TEXT PREVIEW
   ================================================================== */

.note__preview {
    width: 100%;
    margin: 0;

    font-family: var(--font-body);
    font-size: clamp(11px, 1.3vh, 13px);
    line-height: 1.3;

    color: var(--color-ink-soft);
    text-align: center;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
    text-overflow: ellipsis;

    opacity: 0.85;
}


/* ==================================================================
   BACKDROP
   ================================================================== */

#backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;

    background: var(--color-overlay-backdrop);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.28s ease;
}

.backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}


/* ==================================================================
   OVERLAY HOST
   ================================================================== */

#overlay-host {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: var(--app-height, 100dvh);

    z-index: 100;

    pointer-events: none;
}


/* ==================================================================
   NOTE OVERLAY
   Estado final — prioriza as correções posteriores.
   ================================================================== */

.overlay {
    position: absolute;

    top: calc(max(16px, env(safe-area-inset-top)) + 46px);
    left: 20px;
    right: 20px;
    bottom: max(24px, env(safe-area-inset-bottom));

    z-index: 100;

    display: flex;
    flex-direction: column;

    padding: 24px 28px;

    background: var(--color-paper);
    border-radius: 22px;

    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);

    overflow: hidden;

    pointer-events: auto;
}


/* ==================================================================
   OVERLAY HEADER
   ================================================================== */

.overlay__header {
    display: flex;
    align-items: center;

    gap: 12px;

    padding-bottom: 14px;

    border-bottom: 1px solid rgba(38, 36, 26, 0.12);

    flex-shrink: 0;
}

.overlay__actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-shrink: 0;
}


/* ==================================================================
   OVERLAY BUTTONS
   ================================================================== */

.overlay__back,
.overlay__delete,
.overlay__action-btn {
    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    cursor: pointer;
    flex-shrink: 0;

    outline: none;

    transition:
        background-color 0.15s ease,
        transform 0.12s ease,
        color 0.15s ease;
}


/* Back */

.overlay__back {
    background: rgba(38, 36, 26, 0.08);
    color: var(--color-ink);

    font-size: 18px;
}

.overlay__back:hover {
    background: rgba(38, 36, 26, 0.16);
}

.overlay__back:active {
    transform: scale(0.92);
}


/* Delete */

.overlay__delete {
    background: rgba(181, 83, 61, 0.15);
    color: var(--color-danger);

    font-size: 16px;
}

.overlay__delete:hover {
    background: rgba(181, 83, 61, 0.28);
}

.overlay__delete:active {
    transform: scale(0.94);
}


/* Accessibility */

.overlay__back:focus-visible,
.overlay__delete:focus-visible,
.overlay__action-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}


/* ==================================================================
   OVERLAY TITLE
   ================================================================== */

.overlay__title {
    flex: 1;
    min-width: 0;

    padding: 2px 0;

    font-family: var(--font-display);
    font-size: clamp(20px, 3vh, 28px);
    font-weight: 600;

    color: var(--color-ink);
    text-align: left;

    border: none;
    outline: none;
    background: transparent;
}

.overlay__title::placeholder {
    color: var(--color-ink-soft);
    opacity: 0.6;
}


/* ==================================================================
   OVERLAY CONTENT
   ================================================================== */

.overlay__content-wrap {
    position: relative;

    flex: 1;

    display: flex;
    flex-direction: column;

    margin-top: 16px;

    overflow-y: auto;
}

.overlay__content {
    width: 100%;
    min-height: 160px;

    flex: 1;

    padding-right: 48px;

    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;

    color: var(--color-ink);

    background: transparent;
    border: none;
    outline: none;

    white-space: pre-wrap;
    word-break: break-word;

    cursor: text;
}

.overlay__content:empty::before {
    content: attr(data-placeholder);

    color: var(--color-ink-soft);
    opacity: 0.65;

    pointer-events: none;
}


/* Images inserted into notes */

.overlay__content img {
    display: block;

    max-width: 100%;

    margin: 10px 0;

    border-radius: 10px;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.overlay__content video {
    display: block;

    max-width: 100%;

    margin: 10px 0;

    border-radius: 10px;

    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.overlay__content audio {
    display: block;

    width: 100%;

    margin: 10px 0;
}

/* Non-editable "chip" wrapping each media element, so it can be selected
   and removed as a single unit via the ✕ button — clicking the image
   itself opens the lightbox, and video/audio controls cover the whole
   element, so there's no other reliable way to delete them. */
.note-media {
    position: relative;
    display: block;
}

.note-media__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;

    width: 26px;
    height: 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    line-height: 1;

    cursor: pointer;
}

.note-media__remove:hover {
    background: rgba(0, 0, 0, 0.8);
}


/* ==================================================================
   IMAGE BUTTON
   ================================================================== */

.overlay__image-btn {
    position: absolute;

    right: 4px;
    bottom: 4px;

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: rgba(38, 36, 26, 0.55);
    color: var(--color-paper);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    font-size: 15px;
    cursor: pointer;

    transition: background 0.15s ease;
}

.overlay__image-btn:hover {
    background: rgba(38, 36, 26, 0.75);
}


/* ==================================================================
   FILE INPUT
   ================================================================== */

.visually-hidden-file-input {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* ==================================================================
   OVERLAY CHILDREN
   ================================================================== */

.overlay__children-label {
    margin-top: 8px;
    padding-top: 18px;

    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: var(--color-ink-soft);

    border-top: 1px solid rgba(38, 36, 26, 0.14);

    flex-shrink: 0;
}

.overlay__children-label--hidden {
    display: none;
}


/* ==================================================================
   TOOLBAR
   Estado final — correção da barra vertical.
   ================================================================== */

.overlay__toolbar,
.editor-toolbar,
.toolbar {
    display: flex !important;

    flex-direction: row !important;
    flex-wrap: wrap;

    align-items: center;

    gap: 8px;

    width: fit-content;
    height: auto !important;

    margin-top: 12px;
    padding: 8px 12px;

    background: #3A3830;
    color: var(--color-paper);

    border-radius: 10px;

    position: static !important;

    flex-shrink: 0;
}


/* ==================================================================
   TOOLBAR BUTTONS
   ================================================================== */

.overlay__toolbar button,
.editor-toolbar button,
.toolbar button,
.toolbar-btn {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 6px 12px;

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;

    color: var(--color-paper);

    background: rgba(255, 255, 255, 0.12);

    border: none;
    border-radius: 6px;

    cursor: pointer;
    white-space: nowrap;

    transition: background 0.15s ease;
}

.overlay__toolbar button:hover,
.editor-toolbar button:hover,
.toolbar button:hover,
.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}


/* ==================================================================
   FLOATING ACTION BUTTON
   ================================================================== */

#fab-container {
    position: fixed;

    bottom: max(24px, env(safe-area-inset-bottom));
    right: 20px;

    z-index: 200;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 12px;

    opacity: 1;
    pointer-events: auto;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

/* Hidden while a note is open, so it doesn't sit on top of and swallow
   clicks meant for that note's own action button ("Aa") underneath it. */
#fab-container.fab-container--hidden {
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}

#fab {
    width: 58px;
    height: 58px;

    border: none;
    border-radius: var(--radius-fab);

    background: var(--color-accent);
    color: var(--color-canvas);

    font-size: 28px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);

    transition:
        transform 0.25s ease,
        background 0.2s ease;
}

#fab:hover {
    background: #cf9a4f;
}

#fab.fab--open {
    transform: rotate(45deg);
}


/* ==================================================================
   FAB MENU
   ================================================================== */

.fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 8px;

    opacity: 0;
    transform: translateY(8px);

    pointer-events: none;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.fab-menu--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-menu__item {
    padding: 9px 16px;

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;

    color: var(--color-paper);

    background: #232920;

    border: 1px solid rgba(237, 228, 200, 0.12);
    border-radius: 999px;

    cursor: pointer;
    white-space: nowrap;

    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);

    transition: background 0.15s ease;
}

.fab-menu__item:hover {
    background: #2C3327;
}


/* ==================================================================
   STATUS TOAST
   ================================================================== */

#status {
    position: fixed;

    top: max(16px, env(safe-area-inset-top));
    left: 50%;

    z-index: 300;

    max-width: 86vw;

    padding: 9px 16px;

    background: #232920;
    color: var(--color-paper);

    font-family: var(--font-mono);
    font-size: 12.5px;

    text-align: center;

    border-radius: 10px;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);

    opacity: 0;

    transform: translate(-50%, -140%);

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

#status.status--visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

#status.status--error {
    color: #F0A98F;
}


/* ==================================================================
   IMAGE LIGHTBOX
   Full-screen viewer for tapping an image inside an open note.
   ================================================================== */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.2s ease;
}

.image-lightbox--open {
    opacity: 1;
    pointer-events: auto;
}

.image-lightbox__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(6, 7, 4, 0.88);
}

.image-lightbox__img {
    position: relative;

    max-width: 92vw;
    max-height: 92vh;

    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}


/* ==================================================================
   ABOUT MODAL
   ================================================================== */

.about-modal {
    position: fixed;
    inset: 0;

    z-index: 400;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 24px;
}

.about-modal--open {
    display: flex;
}

.about-modal__backdrop {
    position: absolute;
    inset: 0;

    background: var(--color-overlay-backdrop);
}

.about-modal__card {
    position: relative;

    width: 100%;
    max-width: 480px;
    max-height: 84vh;

    overflow-y: auto;

    padding: 40px 28px 32px;

    background: var(--color-paper);
    color: var(--color-ink);

    border-radius: 22px;

    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);

    font-family: var(--font-body);
    line-height: 1.6;
}

.about-modal__close {
    position: absolute;

    top: 16px;
    right: 16px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(38, 36, 26, 0.08);
    color: var(--color-ink-soft);

    font-size: 14px;

    cursor: pointer;
}

.about-modal__close:hover {
    background: rgba(38, 36, 26, 0.16);
}

.about-modal__title {
    margin-bottom: 4px;

    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
}

.about-modal__tagline {
    margin-bottom: 22px;

    font-family: var(--font-mono);
    font-size: 12.5px;

    color: var(--color-ink-soft);
}

.about-modal__card h2 {
    margin-top: 22px;
    margin-bottom: 8px;

    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
}

.about-modal__card p,
.about-modal__card li {
    font-size: 14.5px;
}

.about-modal__card ul {
    margin: 8px 0;
    padding-left: 20px;
}

.about-modal__card li {
    margin-bottom: 6px;
}

.about-modal__card a {
    color: var(--color-accent);
}

.about-modal__cta {
    display: block;

    width: 100%;

    margin-top: 26px;
    padding: 13px 20px;

    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;

    color: var(--color-paper);
    background: var(--color-accent);

    border: none;
    border-radius: 999px;

    cursor: pointer;
}


/* ==================================================================
   SCROLLBARS
   ================================================================== */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);

    border: 2px solid transparent;
    border-radius: 999px;

    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-ink-soft);
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}


/* ==================================================================
   REDUCED MOTION
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
    .note,
    .overlay,
    .fab-menu,
    #fab,
    #status,
    #backdrop {
        transition-duration: 0.01ms !important;
    }
}

/* ==================================================================
   NOTE ACTIONS MENU
   Botão "Aa" + menu de ferramentas da nota
   ================================================================== */

/* The button/menu are appended directly to .overlay (already
   position: absolute), so they stay pinned to the note card's corner
   instead of scrolling away with .overlay__content-wrap's content. */


/* ------------------------------------------------------------------
   Botão de ações — "Aa"
   ------------------------------------------------------------------ */

.overlay__actions-toggle {
    position: absolute;

    right: 8px;
    bottom: 8px;

    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(38, 36, 26, 0.12);
    border-radius: 50%;

    background: rgba(38, 36, 26, 0.08);
    color: var(--color-ink);

    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    z-index: 20;

    transition:
        background-color 0.15s ease,
        transform 0.12s ease,
        box-shadow 0.15s ease;
}

.overlay__actions-toggle:hover {
    background: rgba(38, 36, 26, 0.15);

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.overlay__actions-toggle:active {
    transform: scale(0.92);
}

.overlay__actions-toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}


/* ------------------------------------------------------------------
   Menu
   ------------------------------------------------------------------ */

.overlay__actions-menu {
    position: absolute;

    right: 8px;
    bottom: 54px;

    z-index: 30;

    min-width: 170px;
    max-width: calc(100% - 16px);

    display: flex;
    flex-direction: column;

    padding: 6px;

    background: var(--color-paper);

    border: 1px solid rgba(38, 36, 26, 0.10);
    border-radius: 12px;

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.22),
        0 3px 8px rgba(0, 0, 0, 0.10);

    opacity: 0;
    transform: translateY(6px) scale(0.97);
    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}


/* Menu aberto */

.overlay__actions-menu--open {
    opacity: 1;

    transform: translateY(0) scale(1);

    pointer-events: auto;
}


/* ------------------------------------------------------------------
   Itens do menu
   ------------------------------------------------------------------ */

.overlay__actions-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 11px;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: var(--color-ink);

    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.overlay__actions-item:hover {
    background: rgba(38, 36, 26, 0.08);
}

.overlay__actions-item:active {
    background: rgba(38, 36, 26, 0.14);
}

.overlay__actions-item:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}


/* Ícones/emojis */

.overlay__actions-item > strong {
    min-width: 18px;

    font-family: var(--font-body);
    font-size: 15px;
}


/* Texto */

.overlay__actions-item span {
    flex: 1;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ------------------------------------------------------------------
   Input de imagem dentro do <label>
   ------------------------------------------------------------------ */

.overlay__actions-item .visually-hidden-file-input {
    position: absolute;
}


/* ------------------------------------------------------------------
   Checkbox inserido no conteúdo da nota
   ------------------------------------------------------------------ */

.overlay__content .note-checkbox,
.overlay__content input[type="checkbox"] {
    width: 17px;
    height: 17px;

    margin: 0 4px 0 0;

    accent-color: var(--color-accent);

    vertical-align: middle;

    cursor: pointer;
}


/* ------------------------------------------------------------------
   Links dentro da nota
   ------------------------------------------------------------------ */

.overlay__content a {
    color: var(--color-accent);

    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.overlay__content a:hover {
    color: var(--color-ink);
}


/* ------------------------------------------------------------------
   Negrito dentro da nota
   ------------------------------------------------------------------ */

.overlay__content strong,
.overlay__content b {
    font-weight: 700;
}


/* ------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------ */

@media (max-width: 600px) {
    .overlay__actions-menu {
        right: 6px;
        bottom: 52px;

        min-width: 160px;
    }

    .overlay__actions-item {
        min-height: 42px;

        padding: 10px 12px;

        font-size: 13px;
    }

    .overlay__actions-toggle {
        right: 6px;
        bottom: 6px;

        width: 40px;
        height: 40px;
    }
}


/* ------------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .overlay__actions-menu,
    .overlay__actions-toggle {
        transition-duration: 0.01ms !important;
    }
}