/* ─────────────────────────────────────────
   explanation 페이지 메모 버튼
───────────────────────────────────────── */
.explanation-memo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #8A8A8A;
    position: relative;
}
.explanation-memo-btn:hover {
    color: #FF5D1A;
}
.explanation-memo-btn svg {
    width: 18px;
    height: 18px;
}
#btnMemo.on.explanation-memo-btn {
    color: #FF5D1A;
}

/* ─────────────────────────────────────────
   메모 버튼 배지
───────────────────────────────────────── */
.memo-count-badge {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #FF5D1A;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    vertical-align: middle;
    margin-left: 2px;
}

/* 메모 버튼 활성 상태 */
.small-action-btn#btnMemo.on {
    color: #FF5D1A;
}
.small-action-btn#btnMemo.on svg {
    stroke: #FF5D1A;
}

/* ─────────────────────────────────────────
   인라인 버튼 그룹 (1800px 이하용)
───────────────────────────────────────── */

/* ─────────────────────────────────────────
   메모 드롭다운 패널
───────────────────────────────────────── */
.memo-panel-dropdown {
    position: fixed;
    z-index: 2000;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* 헤더 */
.memo-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.memo-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.memo-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 18px;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.memo-panel-close:hover {
    color: #333;
}

/* 본문 */
.memo-panel-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

/* 목록 아이템 */
.memo-panel-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 16px;
    transition: background 0.15s;
}

.memo-panel-item:hover {
    background: #f9f5f2;
}

.memo-panel-item-date {
    flex-shrink: 0;
    font-size: 11px;
    color: #aaa;
    margin-top: 1px;
}

/* 빈 상태 / 로딩 / 더보기 */
.memo-panel-empty,
.memo-panel-loading,
.memo-panel-more {
    padding: 16px;
    font-size: 12px;
    color: #999;
    text-align: center;
    margin: 0;
}

.memo-panel-more {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 11px;
    padding: 10px 16px;
    text-align: center;
    transition: color 0.2s;
    margin: 0;
}
.memo-panel-more:hover {
    color: #FF5D1A;
    text-decoration: underline;
}

/* 푸터 */
.memo-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.memo-panel-btn-new {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #FF5D1A;
    text-decoration: none;
    transition: color 0.15s;
}

.memo-panel-btn-new:hover {
    color: #e04d0f;
    text-decoration: underline;
}

.memo-panel-btn-all {
    font-size: 12px;
    color: #888;
    text-decoration: none;
}

.memo-panel-btn-all:hover {
    color: #555;
    text-decoration: underline;
}

/* 목록 아이템 버튼 */
.memo-panel-item-title {
    flex: 1;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    white-space: normal;
    word-break: break-word;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    line-height: 1.5;
    /* 2줄 제한 및 말줄임표 처리 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.memo-panel-item-title:hover {
    color: #FF5D1A;
}

/* ─────────────────────────────────────────
   메모 상세 모달
───────────────────────────────────────── */
.memo-detail-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-detail-modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.memo-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.memo-detail-modal-header:active {
    cursor: grabbing;
}

.memo-detail-modal-header .memo-panel-close {
    cursor: pointer;
}

.memo-detail-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.memo-detail-modal-body {
    padding: 20px 18px;
    overflow-y: auto;
    flex: 1;
}

.mdm-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.mdm-date {
    font-size: 11px;
    color: #aaa;
}

.mdm-folder {
    font-size: 11px;
    color: #FF5D1A;
    background: #fff4f0;
    border-radius: 4px;
    padding: 1px 6px;
}

.mdm-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px;
    line-height: 1.4;
}

.mdm-content {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 20px;
}

.mdm-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.mdm-btn-delete,
.mdm-btn-edit,
.mdm-btn-detail {
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    padding: 7px 14px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.mdm-btn-delete {
    color: #c0392b;
    background: #fff0f0;
}
.mdm-btn-delete:hover {
    background: #fdd;
}

.mdm-btn-edit {
    color: #555;
    background: #f0f0f0;
}
.mdm-btn-edit:hover {
    background: #e0e0e0;
}

.mdm-btn-detail {
    color: #fff;
    background: #FF5D1A;
}
.mdm-btn-detail:hover {
    background: #e04d0f;
}

/* ─────────────────────────────────────────
   모바일: 메모 패널 드롭다운 중앙 고정
───────────────────────────────────────── */
@media (max-width: 1024px) {
    .memo-panel-dropdown {
        top: 170px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        width: calc(100vw - 32px) !important;
        max-width: 320px;
    }
}
