/* =========================
   全体
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-size: 14px;
    background-color: #f7f7f7;
}

/* =========================
   共通バー
========================= */
#toolbar-top,
#editor-area,
#search-area,
#filter-area {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px;
    background-color: #ffffff;
    border: 1px solid #ddd;
}

/* =========================
   1行目：操作ボタン
========================= */
#toolbar-top input[type="file"] {
    flex: 1;
}

/* =========================
   2行目：編集エリア
========================= */
#memoEditor {
    flex: 1;
    min-height: 60px;
    resize: vertical;
}

/* =========================
   3行目：検索
========================= */
#searchInput {
    flex: 1;
}

/* =========================
   4行目：表示切替
========================= */
#filter-area label {
    margin-right: 12px;
    white-space: nowrap;
}

/* =========================
   メモ一覧
========================= */
#memo-list {
    background-color: #ffffff;
    border: 1px solid #ddd;
}

/* 1行 */
.memo-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px;
    border-bottom: 1px solid #eee;
}

.memo-row:last-child {
    border-bottom: none;
}

.memo-check {
    margin-top: 3px;
}

.memo-datetime {
    color: #0066cc;
    text-decoration: none;
    white-space: nowrap;
}

.memo-datetime:hover {
    text-decoration: underline;
}

.memo-text {
    flex: 1;
    word-break: break-word;
    cursor: pointer;
}

.memo-text:active {
    background-color: #eef5ff;
}


/* =========================
   固定ヘッダ＆スクロール
========================= */
#toolbar-top,
#editor-area,
#search-area,
#filter-area {
    position: sticky;
    top: 0;
    z-index: 10;
}

#memo-list {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
}

/* =========================
   リンクなし日時表示
========================= */
.memo-datetime.no-link {
    color: #000;
    text-decoration: none;
    cursor: default;
}
