.memo-edit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.memo-edit-modal .quill-editor-wrap {
  min-height: 220px;
}

.memo-edit-modal #memoQuillEditor {
  min-height: 200px;
}

.memo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.memo-action-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.memo-action-group + .memo-action-group {
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.memo-actions .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.3;
}

.memo-actions .btn-accent {
  color: var(--accent);
  border-color: rgba(15, 110, 86, 0.35);
}

.memo-actions .btn.btn-danger {
  background: var(--danger, #dc2626);
  color: #fff;
  border-color: var(--danger, #dc2626);
}

.memo-actions .btn.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}

.memo-actions .btn.btn-main {
  background: var(--accent, #0f6e56);
  color: #fff;
  border-color: var(--accent, #0f6e56);
}

.memo-actions .btn.btn-main:hover {
  background: #0c5a46;
  border-color: #0c5a46;
  color: #fff;
}

.memo-status-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.memo-status-warn {
  font-size: 11px;
  line-height: 1.35;
  color: #b45309;
  max-width: 180px;
}

.memo-status-warn.overdue {
  color: #b91c1c;
}

#memoSheetModalMask,
#memoEditModalMask,
#memoBlockModalMask,
#memoDetailModalMask {
  z-index: 95;
}

body.memo-sheet-modal-open {
  overflow: hidden;
}

#memoSheetModalMask {
  padding: 16px;
  align-items: center;
  justify-content: center;
}

.memo-sheet-modal {
  width: min(96vw, 1280px);
  max-width: 96vw;
  height: min(92vh, 880px);
  max-height: 92vh;
  margin: 0;
  border-radius: 12px;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.modal.memo-sheet-modal .modal-head {
  flex: 0 0 auto;
}

.modal.memo-sheet-modal .modal-body.memo-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.memo-sheet-iframe {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #f8fafc;
}

.tag-memo-pending {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-memo-upcoming {
  background: #fef3c7;
  color: #b45309;
}

.tag-memo-done {
  background: #dcfce7;
  color: #15803d;
}

.tag-memo-overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.memo-detail-modal .modal-body {
  padding: 0 !important;
  max-height: min(78vh, 720px);
  overflow-y: auto;
  background: #eef2f6;
}

.memo-detail-body {
  padding: 0 0 16px;
}

.memo-detail-head {
  padding: 18px 20px 16px;
  background: #fff;
  border-bottom: 1px solid #d1d5db;
}

.memo-detail-head-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  word-break: break-word;
}

.memo-detail-head-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.memo-detail-info-card,
.memo-detail-content-card {
  margin: 12px 16px 0;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 14px 16px;
}

.memo-detail-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.memo-detail-info-row:first-child {
  margin-top: 0;
}

.memo-detail-info-label {
  width: 48px;
  flex-shrink: 0;
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
}

.memo-detail-info-value {
  font-size: 14px;
  color: #1f2937;
  font-weight: 600;
}

.memo-detail-level-chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 3px 10px;
  border: 2px solid #64748b;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
}

.memo-detail-content-head {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.memo-detail-rich-body {
  font-size: 15px;
  line-height: 1.75;
  color: #111827;
  word-break: break-word;
}

.memo-detail-rich-body img {
  max-width: 100%;
  height: auto;
  display: block;
}

.memo-detail-rich-body img.article-img.align-left {
  margin-left: 0;
  margin-right: auto;
}

.memo-detail-rich-body img.article-img.align-center {
  margin-left: auto;
  margin-right: auto;
}

.memo-detail-rich-body img.article-img.align-right {
  margin-left: auto;
  margin-right: 0;
}

.memo-detail-content-empty {
  font-size: 13px;
  color: #64748b;
  padding: 8px 0;
}

.memo-detail-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.memo-detail-foot .btn-danger {
  min-width: 88px;
}
