:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    min-height: 100dvh;
    height: 100dvh;
    box-sizing: border-box;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

#toast-container {
    bottom: calc(1rem + var(--safe-bottom));
}

#status-indicator {
    flex: 0 1 20rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Macライクなクリーンなスクロールバー */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.toast-enter {
    animation: toast-in 0.3s ease-out forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

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

@media (max-width: 768px) {

    #status-indicator,
    #btn-save-as,
    #btn-scroll-sync {
        display: none;
    }

    #app-header {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    #dirty-badge {
        display: none;
    }

    #app-title-text {
        display: inline;
        font-size: 0.875rem;
    }

    #header-actions {
        gap: 0.375rem;
    }

    #header-actions button {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #btn-mobile-toggle {
        display: inline-flex;
        min-width: 3.5rem;
        justify-content: center;
    }

    #txt-lock-btn {
        display: none;
    }

    #editor-pane,
    #preview-pane {
        width: 100%;
        height: 100%;
    }

    #editor-pane {
        border-right: none;
    }

    #preview-pane {
        display: none;
    }

    #app-screen.mobile-preview #editor-pane {
        display: none;
    }

    #app-screen.mobile-preview #preview-pane {
        display: block;
    }

    #editor {
        padding: 1rem;
        font-size: 16px;
    }
}
