*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:system-ui,sans-serif;
    background:#f5f5f5;
    height:100vh;
}

/* 全体 */

.app{
    display:flex;
    height:100vh;
}

/* 左カラム */

.sidebar{
    width:300px;
    background:#222;
    color:#fff;
    display:flex;
    flex-direction:column;
    border-right:1px solid #444;
}

.sidebar-header{
    padding:15px;
    border-bottom:1px solid #444;
    font-size:14px;
    line-height:1.6;
}

.sidebar-header a{
    color:#fff;
    text-decoration:none;
}

.sidebar-header a:hover{
    text-decoration:underline;
}

#newNote{
    margin:10px;
    padding:12px;
    border:none;
    border-radius:6px;
    background:#1f6feb;
    color:#fff;
    font-size:15px;
    cursor:pointer;
}

#newNote:hover{
    opacity:0.9;
}

#noteList{
    flex:1;
    overflow-y:auto;
}

/* メモ一覧 */

.note-item{
    padding:14px;
    border-bottom:1px solid #444;
    cursor:pointer;
    font-size:15px;
    transition:background 0.2s;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.note-item:hover{
    background:#333;
}

/* 右カラム */

.editor{
    flex:1;
    display:flex;
    flex-direction:column;
    padding:20px;
    background:#fff;
}

#title{
    width:100%;
    padding:12px;
    font-size:24px;
    border:1px solid #ccc;
    border-radius:6px;
    margin-bottom:12px;
}

#body{
    flex:1;
    width:100%;
    padding:12px;
    font-size:16px;
    line-height:1.7;
    border:1px solid #ccc;
    border-radius:6px;
    resize:none;
}

/* 下部ボタン */

.editor-footer{
    padding-top:12px;
    display:flex;
    align-items:center;
    gap:10px;
}

button{
    padding:10px 18px;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-size:15px;
}

#saveNote{
    background:#1f6feb;
    color:#fff;
}

#deleteNote{
    background:#ddd;
}

#status{
    color:#666;
    font-size:14px;
}

/* スマホ対応 */

@media (max-width:700px){

    body{
        height:100dvh;
    }

    .app{
        flex-direction:column;
        height:100dvh;
    }

    .sidebar{
        width:100%;
        height:38dvh;
        border-right:none;
        border-bottom:1px solid #444;
    }

    .sidebar-header{
        padding:10px;
        font-size:13px;
    }

    #newNote{
        margin:8px;
        padding:10px;
        font-size:14px;
    }

    .note-item{
        padding:12px;
        font-size:14px;
    }

    .editor{
        flex:1;
        padding:10px;
    }

    #title{
        font-size:18px;
        padding:10px;
        margin-bottom:8px;
    }

    #body{
        font-size:16px;
        line-height:1.6;
    }

    .editor-footer{
        padding-top:8px;
    }

    button{
        flex:1;
        padding:11px;
        font-size:14px;
    }

    #status{
        display:none;
    }
}