.doc-save,
.image-edit-dialog button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid rgba(74, 63, 92, 0.2);
    border-radius: 10px;
    background: #fff;
    color: #51455f;
    font: inherit;
    cursor: pointer;
}

.doc-save:hover { background: #fff4fa; }
.memo-top-actions { display: flex; align-items: center; gap: 4px; }
.memo-draft-status { display: none; }
[data-draft-status].is-error { color: #b13d4c; }
.draft-local-note { margin: 16px 0 0; color: #766d80; font-size: 0.75rem; line-height: 1.5; }
.draft-restored {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #f5effa;
    color: #61516f;
    font-size: 0.85rem;
}
.draft-restored[hidden] { display: none; }
.draft-restored button {
    min-height: 44px;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: #775284;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.share-editor-page .doc-editor figure.is-loading img { opacity: 0.8; filter: none; }
.share-editor-page .doc-editor figure.is-loading::after { display: none; }
.fig-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fig-actions:has(button[hidden]:only-child) { display: none; }
.share-editor-page .doc-editor figure img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y pinch-zoom;
    cursor: context-menu;
}
.share-editor-page .fig-actions button {
    position: static;
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid #ded6e4;
    border-radius: 8px;
    background: #fff;
    color: #5d4c6a;
    font: 0.8rem var(--font-body);
    cursor: pointer;
}
.fig-actions button[hidden] { display: none; }
.fig-state { display: block; margin-top: 4px; color: #74677f; font-size: 0.8rem; }
.is-error .fig-state { color: #b13d4c; }
.share-editor-page button:disabled { opacity: 0.5; cursor: not-allowed; }
.share-editor-page button:focus-visible,
.share-editor-page canvas:focus-visible { outline: 3px solid #8760a5; outline-offset: 3px; }

.image-edit-dialog {
    box-sizing: border-box;
    width: min(720px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 24px;
    overflow-y: auto;
    border: 1px solid #e7dce9;
    border-radius: 18px;
    background: #fffdfb;
    color: #44374f;
    font-family: var(--font-body);
    box-shadow: 0 24px 80px rgba(46, 31, 58, 0.3);
}
.image-edit-dialog::backdrop { background: rgba(35, 24, 44, 0.6); }
.image-edit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-edit-heading h2 { margin: 0; font-size: 1.2rem; color: #44374f; }
.image-edit-dimensions { color: #76677d; font-size: 0.8rem; white-space: nowrap; }
.image-edit-help { margin: 10px 0 16px; color: #74677e; font-size: 0.85rem; line-height: 1.6; }
.image-edit-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background-color: #e9e5eb;
    background-image: conic-gradient(#f5f2f6 25%, transparent 0 50%, #f5f2f6 0 75%, transparent 0);
    background-size: 16px 16px;
    border-radius: 10px;
    overflow: hidden;
}
#share-crop-canvas { display: block; max-width: 100%; touch-action: none; cursor: crosshair; }
.image-edit-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.image-edit-tools button { flex: 1; white-space: nowrap; font-size: 0.85rem; }
.image-edit-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.image-edit-footer .image-edit-apply { border-color: #76518d; background: #76518d; color: #fff; }
.image-edit-gif-note { margin: 12px 0 0; color: #8f6515; font-size: 0.8rem; }
.image-edit-error { margin: 8px 0 0; color: #b13d4c; font-size: 0.85rem; }
.image-edit-error:empty { display: none; }
body:has(.image-edit-dialog[open], .image-actions-menu[open]) { overflow: hidden; }
.image-actions-menu {
    position: fixed;
    inset: auto;
    box-sizing: border-box;
    width: 180px;
    padding: 6px;
    margin: 0;
    border: 1px solid #e7dce9;
    border-radius: 12px;
    background: #fffdfb;
    box-shadow: 0 10px 36px rgba(46, 31, 58, 0.22);
}
.image-actions-menu::backdrop { background: transparent; }
.image-actions-menu button {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #51455f;
    font: 0.95rem var(--font-body);
    text-align: left;
    cursor: pointer;
}
.image-actions-menu button:hover { background: #f6eff9; }
.image-actions-menu .image-action-delete { color: #a23f51; }

@media (max-width: 768px) {
    .share-editor-page .memo-done { min-height: 44px; min-width: 48px; padding: 8px; color: #98650c; }
    .share-editor-page .memo-save { color: #6d6253; font-weight: 400; }
    .memo-draft-status { display: block; margin: 0 0 12px; color: #756c60; font-size: 0.75rem; }
    .image-edit-dialog { padding: 16px; border-radius: 14px; }
    .image-edit-tools { gap: 6px; }
    .image-edit-tools button { padding: 8px; }
    .image-edit-footer button { flex: 1; }
    .draft-local-note { margin-bottom: 12px; }
    .image-actions-menu {
        top: auto !important;
        left: 12px !important;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        padding: 8px;
        border-radius: 16px;
    }
    .image-actions-menu::backdrop { background: rgba(35, 24, 44, 0.35); }
    .image-actions-menu button { min-height: 54px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .share-editor-page * { scroll-behavior: auto !important; }
}
